Documentation ¶
Index ¶
- Constants
- func Exit__0(code int)
- func Exit__1()
- func Gopt_Game_Main(game Gamer, sprites ...Spriter)
- func Gopt_Game_Reload(game Gamer, index interface{}) (err error)
- func Gopt_Game_Run(game Gamer, resource interface{}, gameConf ...*Config)
- func Gopt_Sprite_Clone__0(sprite Spriter)
- func Gopt_Sprite_Clone__1(sprite Spriter, data interface{})
- func Iround(v float64) int
- func Rand__0(from, to int) float64
- func Rand__1(from, to float64) float64
- func Sched() int
- func SchedNow() int
- func SetDebug(flags dbgFlags)
- type Camera
- type Color
- type Config
- type EffectKind
- type Game
- func (p *Game) Answer() Value
- func (p *Game) Ask(msg interface{})
- func (p *Game) Broadcast__0(msg string)
- func (p *Game) Broadcast__1(msg string, wait bool)
- func (p *Game) Broadcast__2(msg string, data interface{}, wait bool)
- func (p *Game) ChangeEffect(kind EffectKind, delta float64)
- func (p *Game) ChangeVolume(delta float64)
- func (p *Game) ClearSoundEffects()
- func (p *Game) Draw(screen *ebiten.Image)
- func (p *Game) EraseAll()
- func (p *Game) HideVar(name string)
- func (p *Game) KeyPressed(key Key) bool
- func (p *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
- func (p *Game) Loudness() float64
- func (p *Game) MouseHitItem() (target *Sprite, ok bool)
- func (p *Game) MousePressed() bool
- func (p *Game) MouseX() float64
- func (p *Game) MouseY() float64
- func (p *Game) NextScene(wait ...bool)
- func (p *Game) OnAnyKey(onKey func(key Key))
- func (p *Game) OnClick(onClick func())
- func (p *Game) OnKey__0(key Key, onKey func())
- func (p *Game) OnKey__1(keys []Key, onKey func(Key))
- func (p *Game) OnKey__2(keys []Key, onKey func())
- func (p *Game) OnMsg__0(onMsg func(msg string, data interface{}))
- func (p *Game) OnMsg__1(msg string, onMsg func())
- func (p *Game) OnScene__0(onScene func(name string))
- func (p *Game) OnScene__1(name string, onScene func())
- func (p *Game) OnStart(onStart func())
- func (p *Game) Play__0(media Sound)
- func (p *Game) Play__1(media Sound, wait bool)
- func (p *Game) Play__2(media Sound, action *PlayOptions)
- func (p *Game) PrevScene(wait ...bool)
- func (p *Game) ResetTimer()
- func (p *Game) SceneIndex() int
- func (p *Game) SceneName() string
- func (p *Game) SetEffect(kind EffectKind, val float64)
- func (p *Game) SetVolume(volume float64)
- func (p *Game) ShowVar(name string)
- func (p *Game) StartScene(scene interface{}, wait ...bool)
- func (p *Game) Stop(kind StopKind)
- func (p *Game) StopAllSounds()
- func (p *Game) Timer() float64
- func (p *Game) Update() error
- func (p *Game) Username() string
- func (p *Game) Volume() float64
- func (p *Game) Wait(secs float64)
- type Gamer
- type Key
- type List
- func (p *List) Append(v obj)
- func (p *List) At(i Pos) Value
- func (p *List) Contains(v obj) bool
- func (p *List) Delete(i Pos)
- func (p *List) Init(data ...obj)
- func (p *List) InitFrom(src *List)
- func (p *List) Insert(i Pos, v obj)
- func (p *List) Len() int
- func (p *List) Set(i Pos, v obj)
- func (p *List) String() string
- type MovingInfo
- type PlayAction
- type PlayOptions
- type Pos
- type RotationStyle
- type Shape
- type Sound
- type Sprite
- func (p *Sprite) Animate(name string)
- func (p *Sprite) Ask(msg interface{})
- func (p *Sprite) BounceOffEdge()
- func (p *Sprite) Bounds() *math32.RotatedRect
- func (p *Sprite) ChangeEffect(kind EffectKind, delta float64)
- func (p *Sprite) ChangeHeading(dir float64)
- func (p *Sprite) ChangePenColor(delta float64)
- func (p *Sprite) ChangePenHue(delta float64)
- func (p *Sprite) ChangePenShade(delta float64)
- func (p *Sprite) ChangePenSize(delta float64)
- func (p *Sprite) ChangeSize(delta float64)
- func (p *Sprite) ChangeXYpos(dx, dy float64)
- func (p *Sprite) ChangeXpos(dx float64)
- func (p *Sprite) ChangeYpos(dy float64)
- func (p *Sprite) ClearGraphEffects()
- func (p *Sprite) CostumeHeight() float64
- func (p *Sprite) CostumeIndex() int
- func (p *Sprite) CostumeName() string
- func (p *Sprite) CostumeWidth() float64
- func (p *Sprite) Destroy()
- func (p *Sprite) Die()
- func (p *Sprite) DistanceTo(obj interface{}) float64
- func (p *Sprite) Glide__0(x, y float64, secs float64)
- func (p *Sprite) Glide__1(obj interface{}, secs float64)
- func (p *Sprite) GoBackLayers(n int)
- func (p *Sprite) Goto(obj interface{})
- func (p *Sprite) GotoBack()
- func (p *Sprite) GotoFront()
- func (p *Sprite) Heading() float64
- func (p *Sprite) Hide()
- func (p *Sprite) HideVar(name string)
- func (p *Sprite) InitFrom(src *Sprite)
- func (p *Sprite) IsCloned() bool
- func (p *Sprite) Move__0(step float64)
- func (p *Sprite) Move__1(step int)
- func (p *Sprite) NextCostume()
- func (p *Sprite) OnAnyKey(onKey func(key Key))
- func (p *Sprite) OnClick(onClick func())
- func (p *Sprite) OnCloned__0(onCloned func(data interface{}))
- func (p *Sprite) OnCloned__1(onCloned func())
- func (p *Sprite) OnKey__0(key Key, onKey func())
- func (p *Sprite) OnKey__1(keys []Key, onKey func(Key))
- func (p *Sprite) OnKey__2(keys []Key, onKey func())
- func (p *Sprite) OnMoving__0(onMoving func(mi *MovingInfo))
- func (p *Sprite) OnMoving__1(onMoving func())
- func (p *Sprite) OnMsg__0(onMsg func(msg string, data interface{}))
- func (p *Sprite) OnMsg__1(msg string, onMsg func())
- func (p *Sprite) OnScene__0(onScene func(name string))
- func (p *Sprite) OnScene__1(name string, onScene func())
- func (p *Sprite) OnStart(onStart func())
- func (p *Sprite) OnTouched__0(onTouched func(obj *Sprite))
- func (p *Sprite) OnTouched__1(onTouched func())
- func (p *Sprite) OnTouched__2(name string, onTouched func(obj *Sprite))
- func (p *Sprite) OnTouched__3(name string, onTouched func())
- func (p *Sprite) OnTouched__4(names []string, onTouched func(obj *Sprite))
- func (p *Sprite) OnTouched__5(names []string, onTouched func())
- func (p *Sprite) OnTurning__0(onTurning func(ti *TurningInfo))
- func (p *Sprite) OnTurning__1(onTurning func())
- func (p *Sprite) Parent() *Game
- func (p *Sprite) PenDown()
- func (p *Sprite) PenUp()
- func (p *Sprite) PrevCostume()
- func (p *Sprite) Quote__0(message string)
- func (p *Sprite) Quote__1(message string, secs float64)
- func (p *Sprite) Quote__2(message, description string, secs ...float64)
- func (p *Sprite) Say(msg interface{}, secs ...float64)
- func (p *Sprite) SetCostume(costume interface{})
- func (p *Sprite) SetDying()
- func (p *Sprite) SetEffect(kind EffectKind, val float64)
- func (p *Sprite) SetHeading(dir float64)
- func (p *Sprite) SetPenColor(color Color)
- func (p *Sprite) SetPenHue(hue float64)
- func (p *Sprite) SetPenShade(shade float64)
- func (p *Sprite) SetPenSize(size float64)
- func (p *Sprite) SetRotationStyle(style RotationStyle)
- func (p *Sprite) SetSize(size float64)
- func (p *Sprite) SetXYpos(x, y float64)
- func (p *Sprite) SetXpos(x float64)
- func (p *Sprite) SetYpos(y float64)
- func (p *Sprite) Show()
- func (p *Sprite) ShowVar(name string)
- func (p *Sprite) Size() float64
- func (p *Sprite) Stamp()
- func (p *Sprite) Step__0(step float64)
- func (p *Sprite) Step__1(step int)
- func (p *Sprite) Step__2(step float64, animname string)
- func (p *Sprite) Stop(kind StopKind)
- func (p *Sprite) Think(msg interface{}, secs ...float64)
- func (p *Sprite) Touching(obj interface{}) bool
- func (p *Sprite) TouchingColor(color Color) bool
- func (p *Sprite) Turn(val interface{})
- func (p *Sprite) TurnTo(obj interface{})
- func (p *Sprite) Visible() bool
- func (p *Sprite) Xpos() float64
- func (p *Sprite) Ypos() float64
- type Spriter
- type StopKind
- type TurningInfo
- type Value
Constants ¶
View Source
const ( GopPackage = true Gop_sched = "Sched,SchedNow" )
View Source
const ( DbgFlagLoad dbgFlags = 1 << iota DbgFlagInstr DbgFlagEvent DbgFlagAll = DbgFlagLoad | DbgFlagInstr | DbgFlagEvent )
View Source
const ( Prev switchAction = -1 Next switchAction = 1 )
View Source
const ( Right specialDir = 90 Left specialDir = -90 Up specialDir = 0 Down specialDir = 180 )
View Source
const ( Mouse specialObj = -5 Edge specialObj = touchingAllEdges EdgeLeft specialObj = touchingScreenLeft EdgeTop specialObj = touchingScreenTop EdgeRight specialObj = touchingScreenRight EdgeBottom specialObj = touchingScreenBottom )
Variables ¶
This section is empty.
Functions ¶
func Gopt_Game_Main ¶ added in v0.8.6
Gopt_Game_Main is required by Go+ compiler as the entry of a .gmx project.
func Gopt_Game_Reload ¶ added in v1.0.0
func Gopt_Game_Run ¶ added in v0.4.0
Gopt_Game_Run runs the game. resource can be a string or fs.Dir object.
func Gopt_Sprite_Clone__0 ¶ added in v0.4.0
func Gopt_Sprite_Clone__0(sprite Spriter)
func Gopt_Sprite_Clone__1 ¶ added in v0.4.0
func Gopt_Sprite_Clone__1(sprite Spriter, data interface{})
Types ¶
type Camera ¶ added in v1.0.0
type Camera struct {
// contains filtered or unexported fields
}
func (*Camera) ChangeXYpos ¶ added in v1.0.0
type Color ¶
type Config ¶ added in v0.2.0
type Config struct { Title string `json:"title,omitempty"` Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` KeyDuration int `json:"keyDuration,omitempty"` ScreenshotKey string `json:"screenshotKey,omitempty"` // screenshot image capture key Index interface{} `json:"-"` // where is index.json, can be file (string) or io.Reader DontParseFlags bool `json:"-"` FullScreen bool `json:"fullScreen,omitempty"` DontRunOnUnfocused bool `json:"pauseOnUnfocused,omitempty"` }
type EffectKind ¶
type EffectKind int
const ( ColorEffect EffectKind = iota BrightnessEffect GhostEffect )
func (EffectKind) String ¶ added in v1.0.0
func (kind EffectKind) String() string
type Game ¶
type Game struct { Camera // contains filtered or unexported fields }
func (*Game) Broadcast__0 ¶ added in v0.3.0
func (*Game) Broadcast__1 ¶ added in v0.3.0
func (*Game) Broadcast__2 ¶ added in v0.3.0
func (*Game) ChangeEffect ¶
func (p *Game) ChangeEffect(kind EffectKind, delta float64)
func (*Game) ChangeVolume ¶
func (*Game) ClearSoundEffects ¶ added in v1.0.0
func (p *Game) ClearSoundEffects()
func (*Game) KeyPressed ¶
func (*Game) MouseHitItem ¶ added in v1.0.0
MouseHitItem returns the topmost item which is hit by mouse.
func (*Game) MousePressed ¶
func (*Game) OnMsg__0 ¶ added in v0.4.0
func (p *Game) OnMsg__0(onMsg func(msg string, data interface{}))
func (*Game) OnScene__0 ¶ added in v0.4.0
func (p *Game) OnScene__0(onScene func(name string))
func (*Game) OnScene__1 ¶ added in v0.5.0
func (p *Game) OnScene__1(name string, onScene func())
func (*Game) Play__0 ¶ added in v0.3.0
Play func:
Play(sound) Play(video) -- maybe Play(media, wait) -- sync Play(media, opts)
func (*Game) Play__2 ¶ added in v1.0.0
func (p *Game) Play__2(media Sound, action *PlayOptions)
func (*Game) ResetTimer ¶
func (p *Game) ResetTimer()
func (*Game) SceneIndex ¶
func (*Game) SetEffect ¶
func (p *Game) SetEffect(kind EffectKind, val float64)
func (*Game) StartScene ¶
StartScene func:
StartScene(sceneName) or StartScene(sceneIndex) or StartScene(spx.Next) StartScene(spx.Prev)
func (*Game) StopAllSounds ¶
func (p *Game) StopAllSounds()
type Key ¶
type Key = ebiten.Key
const ( Key0 Key = ebiten.Key0 Key1 Key = ebiten.Key1 Key2 Key = ebiten.Key2 Key3 Key = ebiten.Key3 Key4 Key = ebiten.Key4 Key5 Key = ebiten.Key5 Key6 Key = ebiten.Key6 Key7 Key = ebiten.Key7 Key8 Key = ebiten.Key8 Key9 Key = ebiten.Key9 KeyA Key = ebiten.KeyA KeyB Key = ebiten.KeyB KeyC Key = ebiten.KeyC KeyD Key = ebiten.KeyD KeyE Key = ebiten.KeyE KeyF Key = ebiten.KeyF KeyG Key = ebiten.KeyG KeyH Key = ebiten.KeyH KeyI Key = ebiten.KeyI KeyJ Key = ebiten.KeyJ KeyK Key = ebiten.KeyK KeyL Key = ebiten.KeyL KeyM Key = ebiten.KeyM KeyN Key = ebiten.KeyN KeyO Key = ebiten.KeyO KeyP Key = ebiten.KeyP KeyQ Key = ebiten.KeyQ KeyR Key = ebiten.KeyR KeyS Key = ebiten.KeyS KeyT Key = ebiten.KeyT KeyU Key = ebiten.KeyU KeyV Key = ebiten.KeyV KeyW Key = ebiten.KeyW KeyX Key = ebiten.KeyX KeyY Key = ebiten.KeyY KeyZ Key = ebiten.KeyZ KeyApostrophe Key = ebiten.KeyApostrophe KeyBackslash Key = ebiten.KeyBackslash KeyBackspace Key = ebiten.KeyBackspace KeyCapsLock Key = ebiten.KeyCapsLock KeyComma Key = ebiten.KeyComma KeyDelete Key = ebiten.KeyDelete KeyDown Key = ebiten.KeyDown KeyEnd Key = ebiten.KeyEnd KeyEnter Key = ebiten.KeyEnter KeyEqual Key = ebiten.KeyEqual KeyEscape Key = ebiten.KeyEscape KeyF1 Key = ebiten.KeyF1 KeyF2 Key = ebiten.KeyF2 KeyF3 Key = ebiten.KeyF3 KeyF4 Key = ebiten.KeyF4 KeyF5 Key = ebiten.KeyF5 KeyF6 Key = ebiten.KeyF6 KeyF7 Key = ebiten.KeyF7 KeyF8 Key = ebiten.KeyF8 KeyF9 Key = ebiten.KeyF9 KeyF10 Key = ebiten.KeyF10 KeyF11 Key = ebiten.KeyF11 KeyF12 Key = ebiten.KeyF12 KeyGraveAccent Key = ebiten.KeyGraveAccent KeyHome Key = ebiten.KeyHome KeyInsert Key = ebiten.KeyInsert KeyKP0 Key = ebiten.KeyKP0 KeyKP1 Key = ebiten.KeyKP1 KeyKP2 Key = ebiten.KeyKP2 KeyKP3 Key = ebiten.KeyKP3 KeyKP4 Key = ebiten.KeyKP4 KeyKP5 Key = ebiten.KeyKP5 KeyKP6 Key = ebiten.KeyKP6 KeyKP7 Key = ebiten.KeyKP7 KeyKP8 Key = ebiten.KeyKP8 KeyKP9 Key = ebiten.KeyKP9 KeyKPDecimal Key = ebiten.KeyKPDecimal KeyKPDivide Key = ebiten.KeyKPDivide KeyKPEnter Key = ebiten.KeyKPEnter KeyKPEqual Key = ebiten.KeyKPEqual KeyKPMultiply Key = ebiten.KeyKPMultiply KeyKPSubtract Key = ebiten.KeyKPSubtract KeyLeft Key = ebiten.KeyLeft KeyLeftBracket Key = ebiten.KeyLeftBracket KeyMenu Key = ebiten.KeyMenu KeyMinus Key = ebiten.KeyMinus KeyNumLock Key = ebiten.KeyNumLock KeyPageDown Key = ebiten.KeyPageDown KeyPageUp Key = ebiten.KeyPageUp KeyPause Key = ebiten.KeyPause KeyPeriod Key = ebiten.KeyPeriod KeyPrintScreen Key = ebiten.KeyPrintScreen KeyRight Key = ebiten.KeyRight KeyRightBracket Key = ebiten.KeyRightBracket KeyScrollLock Key = ebiten.KeyScrollLock KeySemicolon Key = ebiten.KeySemicolon KeySlash Key = ebiten.KeySlash KeySpace Key = ebiten.KeySpace KeyTab Key = ebiten.KeyTab KeyUp Key = ebiten.KeyUp KeyAlt Key = ebiten.KeyAlt KeyControl Key = ebiten.KeyControl KeyShift Key = ebiten.KeyShift KeyMax Key = ebiten.KeyMax KeyAny Key = -1 )
type MovingInfo ¶ added in v0.8.1
type MovingInfo struct {
OldX, OldY float64
NewX, NewY float64
Obj *Sprite
// contains filtered or unexported fields
}
func (*MovingInfo) Dx ¶ added in v0.8.6
func (p *MovingInfo) Dx() float64
func (*MovingInfo) Dy ¶ added in v0.8.6
func (p *MovingInfo) Dy() float64
func (*MovingInfo) StopMoving ¶ added in v1.0.0
func (p *MovingInfo) StopMoving()
type PlayAction ¶ added in v1.0.0
type PlayAction int
const ( PlayRewind PlayAction = iota PlayContinue PlayPause PlayResume PlayStop )
type PlayOptions ¶ added in v1.0.0
type PlayOptions struct { Action PlayAction Wait bool Loop bool }
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
func (*Sprite) BounceOffEdge ¶
func (p *Sprite) BounceOffEdge()
func (*Sprite) Bounds ¶ added in v1.0.0
func (p *Sprite) Bounds() *math32.RotatedRect
func (*Sprite) ChangeEffect ¶ added in v1.0.0
func (p *Sprite) ChangeEffect(kind EffectKind, delta float64)
func (*Sprite) ChangeHeading ¶ added in v1.0.0
func (*Sprite) ChangePenColor ¶
func (*Sprite) ChangePenHue ¶
func (*Sprite) ChangePenShade ¶
func (*Sprite) ChangePenSize ¶
func (*Sprite) ChangeSize ¶
func (*Sprite) ChangeXYpos ¶ added in v0.8.2
func (*Sprite) ChangeXpos ¶
func (*Sprite) ChangeYpos ¶
func (*Sprite) ClearGraphEffects ¶ added in v1.0.0
func (p *Sprite) ClearGraphEffects()
func (*Sprite) CostumeHeight ¶ added in v1.0.0
CostumeHeight returns height of sprite current costume.
func (*Sprite) CostumeIndex ¶
func (*Sprite) CostumeName ¶
func (*Sprite) CostumeWidth ¶ added in v1.0.0
CostumeWidth returns width of sprite current costume.
func (*Sprite) DistanceTo ¶
DistanceTo func:
DistanceTo(sprite) DistanceTo(spriteName) DistanceTo(spx.Mouse) DistanceTo(spx.Random)
func (*Sprite) GoBackLayers ¶
func (*Sprite) Goto ¶
func (p *Sprite) Goto(obj interface{})
Goto func:
Goto(sprite) Goto(spriteName) Goto(spx.Mouse) Goto(spx.Random)
func (*Sprite) NextCostume ¶
func (p *Sprite) NextCostume()
func (*Sprite) OnCloned__0 ¶ added in v0.4.0
func (p *Sprite) OnCloned__0(onCloned func(data interface{}))
func (*Sprite) OnCloned__1 ¶ added in v0.5.0
func (p *Sprite) OnCloned__1(onCloned func())
func (*Sprite) OnMoving__0 ¶ added in v0.8.5
func (p *Sprite) OnMoving__0(onMoving func(mi *MovingInfo))
func (*Sprite) OnMoving__1 ¶ added in v0.8.5
func (p *Sprite) OnMoving__1(onMoving func())
func (*Sprite) OnMsg__0 ¶ added in v0.4.0
func (p *Sprite) OnMsg__0(onMsg func(msg string, data interface{}))
func (*Sprite) OnScene__0 ¶ added in v0.4.0
func (p *Sprite) OnScene__0(onScene func(name string))
func (*Sprite) OnScene__1 ¶ added in v0.5.0
func (p *Sprite) OnScene__1(name string, onScene func())
func (*Sprite) OnTouched__0 ¶ added in v1.0.0
func (*Sprite) OnTouched__1 ¶ added in v1.0.0
func (p *Sprite) OnTouched__1(onTouched func())
func (*Sprite) OnTouched__2 ¶ added in v1.0.0
func (*Sprite) OnTouched__3 ¶ added in v1.0.0
func (*Sprite) OnTouched__4 ¶ added in v1.0.0
func (*Sprite) OnTouched__5 ¶ added in v1.0.0
func (*Sprite) OnTurning__0 ¶ added in v1.0.0
func (p *Sprite) OnTurning__0(onTurning func(ti *TurningInfo))
func (*Sprite) OnTurning__1 ¶ added in v1.0.0
func (p *Sprite) OnTurning__1(onTurning func())
func (*Sprite) PrevCostume ¶ added in v0.7.0
func (p *Sprite) PrevCostume()
func (*Sprite) SetCostume ¶
func (p *Sprite) SetCostume(costume interface{})
func (*Sprite) SetEffect ¶ added in v1.0.0
func (p *Sprite) SetEffect(kind EffectKind, val float64)
func (*Sprite) SetHeading ¶ added in v1.0.0
func (*Sprite) SetPenColor ¶
func (*Sprite) SetPenShade ¶
func (*Sprite) SetPenSize ¶
func (*Sprite) SetRotationStyle ¶
func (p *Sprite) SetRotationStyle(style RotationStyle)
func (*Sprite) Touching ¶
Touching func:
Touching(spriteName) Touching(sprite) Touching(spx.Mouse) Touching(spx.Edge) Touching(spx.EdgeLeft) Touching(spx.EdgeTop) Touching(spx.EdgeRight) Touching(spx.EdgeBottom)
func (*Sprite) TouchingColor ¶
func (*Sprite) Turn ¶
func (p *Sprite) Turn(val interface{})
Turn func:
Turn(degree) Turn(spx.Left) Turn(spx.Right) Turn(ti *spx.TurningInfo)
type StopKind ¶ added in v1.0.0
type StopKind int
const ( AllOtherScripts StopKind = -100 // stop all other scripts AllSprites StopKind = -101 // stop all scripts of sprites ThisSprite StopKind = -102 // stop all scripts of this sprite ThisScript StopKind = -103 // abort this script OtherScriptsInSprite StopKind = -104 // stop other scripts of this sprite )
type TurningInfo ¶ added in v1.0.0
func (*TurningInfo) Dir ¶ added in v1.0.0
func (p *TurningInfo) Dir() float64
Source Files ¶
Click to show internal directories.
Click to hide internal directories.