Documentation
¶
Index ¶
- Constants
- func Exit__0(code int)
- func Exit__1()
- func Gopt_Game_Gopx_GetWidget[T any](sg ShapeGetter, name WidgetName) *T
- func Gopt_Game_Main(game Gamer, sprites ...Sprite)
- func Gopt_Game_Reload(game Gamer, index interface{}) (err error)
- func Gopt_Game_Run(game Gamer, resource interface{}, gameConf ...*Config)
- func Gopt_SpriteImpl_Clone__0(sprite Sprite)
- func Gopt_SpriteImpl_Clone__1(sprite Sprite, 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 BackdropName
- type Camera
- type Collider
- type Color
- type Config
- type EffectKind
- type Game
- func (p *Game) Answer() Value
- func (p *Game) Ask(msg interface{})
- func (p *Game) BackdropIndex() int
- func (p *Game) BackdropName() BackdropName
- 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) IsRunned() bool
- 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 *SpriteImpl, ok bool)
- func (p *Game) MousePressed() bool
- func (p *Game) MouseX() float64
- func (p *Game) MouseY() float64
- func (p *Game) NextBackdrop__0()
- func (p *Game) NextBackdrop__1(wait bool)
- func (p *Game) OnAnyKey(onKey func(key Key))
- func (p *Game) OnBackdrop__0(onBackdrop func(name BackdropName))
- func (p *Game) OnBackdrop__1(name BackdropName, onBackdrop func())
- 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) 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) Play__3(media SoundName)
- func (p *Game) Play__4(media SoundName, wait bool)
- func (p *Game) Play__5(media SoundName, action *PlayOptions)
- func (p *Game) PrevBackdrop__0()
- func (p *Game) PrevBackdrop__1(wait bool)
- func (p *Game) ResetTimer()
- func (p *Game) SetEffect(kind EffectKind, val float64)
- func (p *Game) SetVolume(volume float64)
- func (p *Game) ShowVar(name string)
- func (p *Game) StartBackdrop__0(backdrop BackdropName)
- func (p *Game) StartBackdrop__1(backdrop BackdropName, wait bool)
- func (p *Game) StartBackdrop__2(index float64)
- func (p *Game) StartBackdrop__3(index float64, wait bool)
- func (p *Game) StartBackdrop__4(index int)
- func (p *Game) StartBackdrop__5(index int, wait bool)
- func (p *Game) StartBackdrop__6(action switchAction)
- func (p *Game) StartBackdrop__7(action switchAction, 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 IEventSinks
- 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 Monitor
- func (pself *Monitor) ChangeSize(delta float64)
- func (pself *Monitor) ChangeXYpos(dx float64, dy float64)
- func (pself *Monitor) ChangeXpos(dx float64)
- func (pself *Monitor) ChangeYpos(dy float64)
- func (pself *Monitor) GetName() WidgetName
- func (pself *Monitor) Hide()
- func (pself *Monitor) SetSize(size float64)
- func (pself *Monitor) SetXYpos(x float64, y float64)
- func (pself *Monitor) SetXpos(x float64)
- func (pself *Monitor) SetYpos(y float64)
- func (pself *Monitor) Show()
- func (pself *Monitor) Size() float64
- func (pself *Monitor) Visible() bool
- func (pself *Monitor) Xpos() float64
- func (pself *Monitor) Ypos() float64
- type MovingInfo
- type PlayAction
- type PlayOptions
- type Pos
- type RotationStyle
- type Shape
- type ShapeGetter
- type Sound
- type SoundName
- type Sprite
- type SpriteAnimationName
- type SpriteCostumeName
- type SpriteImpl
- func (p *SpriteImpl) Animate(name SpriteAnimationName)
- func (p *SpriteImpl) Ask(msg interface{})
- func (p *SpriteImpl) BounceOffEdge()
- func (p *SpriteImpl) Bounds() *math32.RotatedRect
- func (p *SpriteImpl) ChangeEffect(kind EffectKind, delta float64)
- func (p *SpriteImpl) ChangeHeading(dir float64)
- func (p *SpriteImpl) ChangePenColor(delta float64)
- func (p *SpriteImpl) ChangePenHue(delta float64)
- func (p *SpriteImpl) ChangePenShade(delta float64)
- func (p *SpriteImpl) ChangePenSize(delta float64)
- func (p *SpriteImpl) ChangeSize(delta float64)
- func (p *SpriteImpl) ChangeXYpos(dx, dy float64)
- func (p *SpriteImpl) ChangeXpos(dx float64)
- func (p *SpriteImpl) ChangeYpos(dy float64)
- func (p *SpriteImpl) ClearGraphEffects()
- func (p *SpriteImpl) CostumeHeight() float64
- func (p *SpriteImpl) CostumeIndex() int
- func (p *SpriteImpl) CostumeName() SpriteCostumeName
- func (p *SpriteImpl) CostumeWidth() float64
- func (p *SpriteImpl) DeleteThisClone()
- func (p *SpriteImpl) Destroy()
- func (p *SpriteImpl) Die()
- func (p *SpriteImpl) DistanceTo__0(sprite Sprite) float64
- func (p *SpriteImpl) DistanceTo__1(sprite SpriteName) float64
- func (p *SpriteImpl) DistanceTo__2(obj specialObj) float64
- func (p *SpriteImpl) DistanceTo__3(pos Pos) float64
- func (p *SpriteImpl) Glide__0(x, y float64, secs float64)
- func (p *SpriteImpl) Glide__1(sprite Sprite, secs float64)
- func (p *SpriteImpl) Glide__2(sprite SpriteName, secs float64)
- func (p *SpriteImpl) Glide__3(obj specialObj, secs float64)
- func (p *SpriteImpl) Glide__4(pos Pos, secs float64)
- func (p *SpriteImpl) GoBackLayers(n int)
- func (p *SpriteImpl) GotoBack()
- func (p *SpriteImpl) GotoFront()
- func (p *SpriteImpl) Goto__0(sprite Sprite)
- func (p *SpriteImpl) Goto__1(sprite SpriteName)
- func (p *SpriteImpl) Goto__2(obj specialObj)
- func (p *SpriteImpl) Heading() float64
- func (p *SpriteImpl) Hide()
- func (p *SpriteImpl) HideVar(name string)
- func (p *SpriteImpl) InitFrom(src *SpriteImpl)
- func (p *SpriteImpl) IsCloned() bool
- func (p *SpriteImpl) Main()
- func (p *SpriteImpl) Move__0(step float64)
- func (p *SpriteImpl) Move__1(step int)
- func (p *SpriteImpl) Name() string
- func (p *SpriteImpl) NextCostume()
- func (p *SpriteImpl) OnAnyKey(onKey func(key Key))
- func (p *SpriteImpl) OnBackdrop__0(onBackdrop func(name BackdropName))
- func (p *SpriteImpl) OnBackdrop__1(name BackdropName, onBackdrop func())
- func (p *SpriteImpl) OnClick(onClick func())
- func (p *SpriteImpl) OnCloned__0(onCloned func(data interface{}))
- func (p *SpriteImpl) OnCloned__1(onCloned func())
- func (p *SpriteImpl) OnKey__0(key Key, onKey func())
- func (p *SpriteImpl) OnKey__1(keys []Key, onKey func(Key))
- func (p *SpriteImpl) OnKey__2(keys []Key, onKey func())
- func (p *SpriteImpl) OnMoving__0(onMoving func(mi *MovingInfo))
- func (p *SpriteImpl) OnMoving__1(onMoving func())
- func (p *SpriteImpl) OnMsg__0(onMsg func(msg string, data interface{}))
- func (p *SpriteImpl) OnMsg__1(msg string, onMsg func())
- func (p *SpriteImpl) OnStart(onStart func())
- func (p *SpriteImpl) OnTouchStart__0(onTouchStart func(Sprite))
- func (p *SpriteImpl) OnTouchStart__1(onTouchStart func())
- func (p *SpriteImpl) OnTouchStart__2(sprite SpriteName, onTouchStart func(Sprite))
- func (p *SpriteImpl) OnTouchStart__3(sprite SpriteName, onTouchStart func())
- func (p *SpriteImpl) OnTouchStart__4(sprites []SpriteName, onTouchStart func(Sprite))
- func (p *SpriteImpl) OnTouchStart__5(sprites []SpriteName, onTouchStart func())
- func (p *SpriteImpl) OnTurning__0(onTurning func(ti *TurningInfo))
- func (p *SpriteImpl) OnTurning__1(onTurning func())
- func (p *SpriteImpl) Parent() *Game
- func (p *SpriteImpl) PenDown()
- func (p *SpriteImpl) PenUp()
- func (p *SpriteImpl) PrevCostume()
- func (p *SpriteImpl) Quote__0(message string)
- func (p *SpriteImpl) Quote__1(message string, secs float64)
- func (p *SpriteImpl) Quote__2(message, description string)
- func (p *SpriteImpl) Quote__3(message, description string, secs float64)
- func (p *SpriteImpl) Say__0(msg interface{})
- func (p *SpriteImpl) Say__1(msg interface{}, secs float64)
- func (p *SpriteImpl) SetCostume__0(costume SpriteCostumeName)
- func (p *SpriteImpl) SetCostume__1(index float64)
- func (p *SpriteImpl) SetCostume__2(index int)
- func (p *SpriteImpl) SetCostume__3(action switchAction)
- func (p *SpriteImpl) SetDying()
- func (p *SpriteImpl) SetEffect(kind EffectKind, val float64)
- func (p *SpriteImpl) SetHeading(dir float64)
- func (p *SpriteImpl) SetPenColor(color Color)
- func (p *SpriteImpl) SetPenHue(hue float64)
- func (p *SpriteImpl) SetPenShade(shade float64)
- func (p *SpriteImpl) SetPenSize(size float64)
- func (p *SpriteImpl) SetRotationStyle(style RotationStyle)
- func (p *SpriteImpl) SetSize(size float64)
- func (p *SpriteImpl) SetXYpos(x, y float64)
- func (p *SpriteImpl) SetXpos(x float64)
- func (p *SpriteImpl) SetYpos(y float64)
- func (p *SpriteImpl) Show()
- func (p *SpriteImpl) ShowVar(name string)
- func (p *SpriteImpl) Size() float64
- func (p *SpriteImpl) Stamp()
- func (p *SpriteImpl) Step__0(step float64)
- func (p *SpriteImpl) Step__1(step float64, animation SpriteAnimationName)
- func (p *SpriteImpl) Step__2(step int)
- func (p *SpriteImpl) Stop(kind StopKind)
- func (p *SpriteImpl) Think__0(msg interface{})
- func (p *SpriteImpl) Think__1(msg interface{}, secs float64)
- func (p *SpriteImpl) TouchingColor(color Color) bool
- func (p *SpriteImpl) Touching__0(sprite SpriteName) bool
- func (p *SpriteImpl) Touching__1(sprite Sprite) bool
- func (p *SpriteImpl) Touching__2(obj specialObj) bool
- func (p *SpriteImpl) TurnTo__0(sprite Sprite)
- func (p *SpriteImpl) TurnTo__1(sprite SpriteName)
- func (p *SpriteImpl) TurnTo__2(degree float64)
- func (p *SpriteImpl) TurnTo__3(dir specialDir)
- func (p *SpriteImpl) TurnTo__4(obj specialObj)
- func (p *SpriteImpl) Turn__0(degree float64)
- func (p *SpriteImpl) Turn__1(dir specialDir)
- func (p *SpriteImpl) Turn__2(ti *TurningInfo)
- func (p *SpriteImpl) Visible() bool
- func (p *SpriteImpl) Xpos() float64
- func (p *SpriteImpl) Ypos() float64
- type SpriteName
- type StopKind
- type TurningInfo
- type Value
- type Widget
- type WidgetName
Constants ¶
const ( GopPackage = true Gop_sched = "Sched,SchedNow" )
const ( DbgFlagLoad dbgFlags = 1 << iota DbgFlagInstr DbgFlagEvent DbgFlagPerf DbgFlagAll = DbgFlagLoad | DbgFlagInstr | DbgFlagEvent | DbgFlagPerf )
const ( Prev switchAction = -1 Next switchAction = 1 )
const ( Right specialDir = 90 Left specialDir = -90 Up specialDir = 0 Down specialDir = 180 )
const ( Mouse specialObj = -5 Edge specialObj = touchingAllEdges EdgeLeft specialObj = touchingScreenLeft EdgeTop specialObj = touchingScreenTop EdgeRight specialObj = touchingScreenRight EdgeBottom specialObj = touchingScreenBottom )
const ( StateDie string = "die" StateTurn string = "turn" StateGlide string = "glide" StateStep string = "step" )
const ( AnimChannelFrame string = "@frame" AnimChannelTurn string = "@turn" AnimChannelGlide string = "@glide" AnimChannelMove string = "@move" )
Variables ¶
This section is empty.
Functions ¶
func Gopt_Game_Gopx_GetWidget ¶ added in v1.1.0
func Gopt_Game_Gopx_GetWidget[T any](sg ShapeGetter, name WidgetName) *T
GetWidget returns the widget instance (in given type) with given name. It panics if not found.
func Gopt_Game_Main ¶ added in v0.8.6
Gopt_Game_Main is required by XGo 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_SpriteImpl_Clone__0 ¶ added in v1.1.0
func Gopt_SpriteImpl_Clone__0(sprite Sprite)
func Gopt_SpriteImpl_Clone__1 ¶ added in v1.1.0
func Gopt_SpriteImpl_Clone__1(sprite Sprite, data interface{})
Types ¶
type BackdropName ¶ added in v1.1.0
type BackdropName = string
type Camera ¶ added in v1.0.0
type Camera struct {
// contains filtered or unexported fields
}
func (*Camera) ChangeXYpos ¶ added in v1.0.0
func (*Camera) On__1 ¶ added in v1.1.0
func (c *Camera) On__1(sprite *SpriteImpl)
func (*Camera) On__2 ¶ added in v1.1.0
func (c *Camera) On__2(sprite SpriteName)
type Collider ¶ added in v1.1.0
type Collider struct {
// contains filtered or unexported fields
}
func (*Collider) SetTouching ¶ added in v1.1.0
func (c *Collider) SetTouching(other *SpriteImpl, on bool)
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) BackdropIndex ¶ added in v1.1.0
func (*Game) BackdropName ¶ added in v1.1.0
func (p *Game) BackdropName() BackdropName
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
func (p *Game) MouseHitItem() (target *SpriteImpl, ok bool)
MouseHitItem returns the topmost item which is hit by mouse.
func (*Game) MousePressed ¶
func (*Game) NextBackdrop__0 ¶ added in v1.1.0
func (p *Game) NextBackdrop__0()
func (*Game) NextBackdrop__1 ¶ added in v1.1.0
func (*Game) OnBackdrop__0 ¶ added in v1.1.0
func (p *Game) OnBackdrop__0(onBackdrop func(name BackdropName))
func (*Game) OnBackdrop__1 ¶ added in v1.1.0
func (p *Game) OnBackdrop__1(name BackdropName, onBackdrop func())
func (*Game) OnMsg__0 ¶ added in v0.4.0
func (p *Game) OnMsg__0(onMsg func(msg string, data interface{}))
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) Play__5 ¶ added in v1.1.0
func (p *Game) Play__5(media SoundName, action *PlayOptions)
func (*Game) PrevBackdrop__0 ¶ added in v1.1.0
func (p *Game) PrevBackdrop__0()
func (*Game) PrevBackdrop__1 ¶ added in v1.1.0
func (*Game) ResetTimer ¶
func (p *Game) ResetTimer()
func (*Game) SetEffect ¶
func (p *Game) SetEffect(kind EffectKind, val float64)
func (*Game) StartBackdrop__0 ¶ added in v1.1.0
func (p *Game) StartBackdrop__0(backdrop BackdropName)
func (*Game) StartBackdrop__1 ¶ added in v1.1.0
func (p *Game) StartBackdrop__1(backdrop BackdropName, wait bool)
func (*Game) StartBackdrop__2 ¶ added in v1.1.0
func (*Game) StartBackdrop__3 ¶ added in v1.1.0
func (*Game) StartBackdrop__4 ¶ added in v1.1.0
func (*Game) StartBackdrop__5 ¶ added in v1.1.0
func (*Game) StartBackdrop__6 ¶ added in v1.1.0
func (p *Game) StartBackdrop__6(action switchAction)
func (*Game) StartBackdrop__7 ¶ added in v1.1.0
func (*Game) StopAllSounds ¶
func (p *Game) StopAllSounds()
type IEventSinks ¶ added in v1.1.0
type IEventSinks interface {
OnAnyKey(onKey func(key Key))
OnBackdrop__0(onBackdrop func(name BackdropName))
OnBackdrop__1(name BackdropName, onBackdrop func())
OnClick(onClick func())
OnKey__0(key Key, onKey func())
OnKey__1(keys []Key, onKey func(Key))
OnKey__2(keys []Key, onKey func())
OnMsg__0(onMsg func(msg string, data interface{}))
OnMsg__1(msg string, onMsg func())
OnStart(onStart func())
Stop(kind StopKind)
}
-------------------------------------------------------------------------------------
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 Monitor ¶ added in v1.1.0
type Monitor struct {
// contains filtered or unexported fields
}
Monitor class.
func (*Monitor) ChangeSize ¶ added in v1.1.0
func (*Monitor) ChangeXYpos ¶ added in v1.1.0
func (*Monitor) ChangeXpos ¶ added in v1.1.0
func (*Monitor) ChangeYpos ¶ added in v1.1.0
func (*Monitor) GetName ¶ added in v1.1.0
func (pself *Monitor) GetName() WidgetName
------------------------------------------------------------------------------------- IWidget
type MovingInfo ¶ added in v0.8.1
type MovingInfo struct {
OldX, OldY float64
NewX, NewY float64
Obj *SpriteImpl
// 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 ShapeGetter ¶ added in v1.1.0
type ShapeGetter interface {
// contains filtered or unexported methods
}
type Sprite ¶
type Sprite interface {
IEventSinks
Shape
Main()
Animate(name SpriteAnimationName)
Ask(msg interface{})
BounceOffEdge()
Bounds() *math32.RotatedRect
ChangeEffect(kind EffectKind, delta float64)
ChangeHeading(dir float64)
ChangePenColor(delta float64)
ChangePenHue(delta float64)
ChangePenShade(delta float64)
ChangePenSize(delta float64)
ChangeSize(delta float64)
ChangeXpos(dx float64)
ChangeXYpos(dx, dy float64)
ChangeYpos(dy float64)
ClearGraphEffects()
CostumeHeight() float64
CostumeIndex() int
CostumeName() SpriteCostumeName
CostumeWidth() float64
DeleteThisClone()
Destroy()
Die()
DistanceTo__0(sprite Sprite) float64
DistanceTo__1(sprite SpriteName) float64
DistanceTo__2(obj specialObj) float64
DistanceTo__3(pos Pos) float64
Glide__0(x, y float64, secs float64)
Glide__1(sprite Sprite, secs float64)
Glide__2(sprite SpriteName, secs float64)
Glide__3(obj specialObj, secs float64)
Glide__4(pos Pos, secs float64)
GoBackLayers(n int)
Goto__0(sprite Sprite)
Goto__1(sprite SpriteName)
Goto__2(obj specialObj)
GotoBack()
GotoFront()
Heading() float64
Hide()
HideVar(name string)
IsCloned() bool
Move__0(step float64)
Move__1(step int)
NextCostume()
Name() string
OnCloned__0(onCloned func(data interface{}))
OnCloned__1(onCloned func())
OnMoving__0(onMoving func(mi *MovingInfo))
OnMoving__1(onMoving func())
OnTouchStart__0(onTouchStart func(Sprite))
OnTouchStart__1(onTouchStart func())
OnTouchStart__2(sprite SpriteName, onTouchStart func(Sprite))
OnTouchStart__3(sprite SpriteName, onTouchStart func())
OnTouchStart__4(sprite []SpriteName, onTouchStart func(Sprite))
OnTouchStart__5(sprite []SpriteName, onTouchStart func())
OnTurning__0(onTurning func(ti *TurningInfo))
OnTurning__1(onTurning func())
Parent() *Game
PenDown()
PenUp()
PrevCostume()
Quote__0(message string)
Quote__1(message string, secs float64)
Quote__2(message, description string)
Quote__3(message, description string, secs float64)
Say__0(msg interface{})
Say__1(msg interface{}, secs float64)
SetCostume__0(costume SpriteCostumeName)
SetCostume__1(index float64)
SetCostume__2(index int)
SetCostume__3(action switchAction)
SetDying()
SetEffect(kind EffectKind, val float64)
SetHeading(dir float64)
SetPenColor(color Color)
SetPenHue(hue float64)
SetPenShade(shade float64)
SetPenSize(size float64)
SetRotationStyle(style RotationStyle)
SetSize(size float64)
SetXpos(x float64)
SetXYpos(x, y float64)
SetYpos(y float64)
Show()
ShowVar(name string)
Size() float64
Stamp()
Step__0(step float64)
Step__1(step float64, animation SpriteAnimationName)
Step__2(step int)
Think__0(msg interface{})
Think__1(msg interface{}, secs float64)
Touching__0(sprite SpriteName) bool
Touching__1(sprite Sprite) bool
Touching__2(obj specialObj) bool
TouchingColor(color Color) bool
Turn__0(degree float64)
Turn__1(dir specialDir)
Turn__2(ti *TurningInfo)
TurnTo__0(sprite Sprite)
TurnTo__1(sprite SpriteName)
TurnTo__2(degree float64)
TurnTo__3(dir specialDir)
TurnTo__4(obj specialObj)
Visible() bool
Xpos() float64
Ypos() float64
}
type SpriteAnimationName ¶ added in v1.1.0
type SpriteAnimationName = string
type SpriteCostumeName ¶ added in v1.1.0
type SpriteCostumeName = string
type SpriteImpl ¶ added in v1.1.0
type SpriteImpl struct {
// contains filtered or unexported fields
}
func (*SpriteImpl) Animate ¶ added in v1.1.0
func (p *SpriteImpl) Animate(name SpriteAnimationName)
func (*SpriteImpl) Ask ¶ added in v1.1.0
func (p *SpriteImpl) Ask(msg interface{})
func (*SpriteImpl) BounceOffEdge ¶ added in v1.1.0
func (p *SpriteImpl) BounceOffEdge()
func (*SpriteImpl) Bounds ¶ added in v1.1.0
func (p *SpriteImpl) Bounds() *math32.RotatedRect
func (*SpriteImpl) ChangeEffect ¶ added in v1.1.0
func (p *SpriteImpl) ChangeEffect(kind EffectKind, delta float64)
func (*SpriteImpl) ChangeHeading ¶ added in v1.1.0
func (p *SpriteImpl) ChangeHeading(dir float64)
func (*SpriteImpl) ChangePenColor ¶ added in v1.1.0
func (p *SpriteImpl) ChangePenColor(delta float64)
func (*SpriteImpl) ChangePenHue ¶ added in v1.1.0
func (p *SpriteImpl) ChangePenHue(delta float64)
func (*SpriteImpl) ChangePenShade ¶ added in v1.1.0
func (p *SpriteImpl) ChangePenShade(delta float64)
func (*SpriteImpl) ChangePenSize ¶ added in v1.1.0
func (p *SpriteImpl) ChangePenSize(delta float64)
func (*SpriteImpl) ChangeSize ¶ added in v1.1.0
func (p *SpriteImpl) ChangeSize(delta float64)
func (*SpriteImpl) ChangeXYpos ¶ added in v1.1.0
func (p *SpriteImpl) ChangeXYpos(dx, dy float64)
func (*SpriteImpl) ChangeXpos ¶ added in v1.1.0
func (p *SpriteImpl) ChangeXpos(dx float64)
func (*SpriteImpl) ChangeYpos ¶ added in v1.1.0
func (p *SpriteImpl) ChangeYpos(dy float64)
func (*SpriteImpl) ClearGraphEffects ¶ added in v1.1.0
func (p *SpriteImpl) ClearGraphEffects()
func (*SpriteImpl) CostumeHeight ¶ added in v1.1.0
func (p *SpriteImpl) CostumeHeight() float64
CostumeHeight returns height of sprite current costume.
func (*SpriteImpl) CostumeIndex ¶ added in v1.1.0
func (p *SpriteImpl) CostumeIndex() int
func (*SpriteImpl) CostumeName ¶ added in v1.1.0
func (p *SpriteImpl) CostumeName() SpriteCostumeName
func (*SpriteImpl) CostumeWidth ¶ added in v1.1.0
func (p *SpriteImpl) CostumeWidth() float64
CostumeWidth returns width of sprite current costume.
func (*SpriteImpl) DeleteThisClone ¶ added in v1.1.0
func (p *SpriteImpl) DeleteThisClone()
delete only cloned sprite, no effect on prototype sprite. Add this interface, to match Scratch.
func (*SpriteImpl) Destroy ¶ added in v1.1.0
func (p *SpriteImpl) Destroy()
func (*SpriteImpl) Die ¶ added in v1.1.0
func (p *SpriteImpl) Die()
func (*SpriteImpl) DistanceTo__0 ¶ added in v1.1.0
func (p *SpriteImpl) DistanceTo__0(sprite Sprite) float64
func (*SpriteImpl) DistanceTo__1 ¶ added in v1.1.0
func (p *SpriteImpl) DistanceTo__1(sprite SpriteName) float64
func (*SpriteImpl) DistanceTo__2 ¶ added in v1.1.0
func (p *SpriteImpl) DistanceTo__2(obj specialObj) float64
func (*SpriteImpl) DistanceTo__3 ¶ added in v1.1.0
func (p *SpriteImpl) DistanceTo__3(pos Pos) float64
func (*SpriteImpl) Glide__0 ¶ added in v1.1.0
func (p *SpriteImpl) Glide__0(x, y float64, secs float64)
func (*SpriteImpl) Glide__1 ¶ added in v1.1.0
func (p *SpriteImpl) Glide__1(sprite Sprite, secs float64)
func (*SpriteImpl) Glide__2 ¶ added in v1.1.0
func (p *SpriteImpl) Glide__2(sprite SpriteName, secs float64)
func (*SpriteImpl) Glide__3 ¶ added in v1.1.0
func (p *SpriteImpl) Glide__3(obj specialObj, secs float64)
func (*SpriteImpl) Glide__4 ¶ added in v1.1.0
func (p *SpriteImpl) Glide__4(pos Pos, secs float64)
func (*SpriteImpl) GoBackLayers ¶ added in v1.1.0
func (p *SpriteImpl) GoBackLayers(n int)
func (*SpriteImpl) GotoBack ¶ added in v1.1.0
func (p *SpriteImpl) GotoBack()
func (*SpriteImpl) GotoFront ¶ added in v1.1.0
func (p *SpriteImpl) GotoFront()
func (*SpriteImpl) Goto__0 ¶ added in v1.1.0
func (p *SpriteImpl) Goto__0(sprite Sprite)
func (*SpriteImpl) Goto__1 ¶ added in v1.1.0
func (p *SpriteImpl) Goto__1(sprite SpriteName)
func (*SpriteImpl) Goto__2 ¶ added in v1.1.0
func (p *SpriteImpl) Goto__2(obj specialObj)
func (*SpriteImpl) Heading ¶ added in v1.1.0
func (p *SpriteImpl) Heading() float64
func (*SpriteImpl) Hide ¶ added in v1.1.0
func (p *SpriteImpl) Hide()
func (*SpriteImpl) HideVar ¶ added in v1.1.0
func (p *SpriteImpl) HideVar(name string)
func (*SpriteImpl) InitFrom ¶ added in v1.1.0
func (p *SpriteImpl) InitFrom(src *SpriteImpl)
func (*SpriteImpl) IsCloned ¶ added in v1.1.0
func (p *SpriteImpl) IsCloned() bool
func (*SpriteImpl) Main ¶ added in v1.1.2
func (p *SpriteImpl) Main()
func (*SpriteImpl) Move__0 ¶ added in v1.1.0
func (p *SpriteImpl) Move__0(step float64)
func (*SpriteImpl) Move__1 ¶ added in v1.1.0
func (p *SpriteImpl) Move__1(step int)
func (*SpriteImpl) Name ¶ added in v1.1.2
func (p *SpriteImpl) Name() string
func (*SpriteImpl) NextCostume ¶ added in v1.1.0
func (p *SpriteImpl) NextCostume()
func (*SpriteImpl) OnBackdrop__0 ¶ added in v1.1.0
func (p *SpriteImpl) OnBackdrop__0(onBackdrop func(name BackdropName))
func (*SpriteImpl) OnBackdrop__1 ¶ added in v1.1.0
func (p *SpriteImpl) OnBackdrop__1(name BackdropName, onBackdrop func())
func (*SpriteImpl) OnCloned__0 ¶ added in v1.1.0
func (p *SpriteImpl) OnCloned__0(onCloned func(data interface{}))
func (*SpriteImpl) OnCloned__1 ¶ added in v1.1.0
func (p *SpriteImpl) OnCloned__1(onCloned func())
func (*SpriteImpl) OnKey__2 ¶ added in v1.1.0
func (p *SpriteImpl) OnKey__2(keys []Key, onKey func())
func (*SpriteImpl) OnMoving__0 ¶ added in v1.1.0
func (p *SpriteImpl) OnMoving__0(onMoving func(mi *MovingInfo))
func (*SpriteImpl) OnMoving__1 ¶ added in v1.1.0
func (p *SpriteImpl) OnMoving__1(onMoving func())
func (*SpriteImpl) OnMsg__0 ¶ added in v1.1.0
func (p *SpriteImpl) OnMsg__0(onMsg func(msg string, data interface{}))
func (*SpriteImpl) OnMsg__1 ¶ added in v1.1.0
func (p *SpriteImpl) OnMsg__1(msg string, onMsg func())
func (*SpriteImpl) OnTouchStart__0 ¶ added in v1.1.0
func (p *SpriteImpl) OnTouchStart__0(onTouchStart func(Sprite))
func (*SpriteImpl) OnTouchStart__1 ¶ added in v1.1.0
func (p *SpriteImpl) OnTouchStart__1(onTouchStart func())
func (*SpriteImpl) OnTouchStart__2 ¶ added in v1.1.0
func (p *SpriteImpl) OnTouchStart__2(sprite SpriteName, onTouchStart func(Sprite))
func (*SpriteImpl) OnTouchStart__3 ¶ added in v1.1.0
func (p *SpriteImpl) OnTouchStart__3(sprite SpriteName, onTouchStart func())
func (*SpriteImpl) OnTouchStart__4 ¶ added in v1.1.2
func (p *SpriteImpl) OnTouchStart__4(sprites []SpriteName, onTouchStart func(Sprite))
func (*SpriteImpl) OnTouchStart__5 ¶ added in v1.1.2
func (p *SpriteImpl) OnTouchStart__5(sprites []SpriteName, onTouchStart func())
func (*SpriteImpl) OnTurning__0 ¶ added in v1.1.0
func (p *SpriteImpl) OnTurning__0(onTurning func(ti *TurningInfo))
func (*SpriteImpl) OnTurning__1 ¶ added in v1.1.0
func (p *SpriteImpl) OnTurning__1(onTurning func())
func (*SpriteImpl) Parent ¶ added in v1.1.0
func (p *SpriteImpl) Parent() *Game
func (*SpriteImpl) PenDown ¶ added in v1.1.0
func (p *SpriteImpl) PenDown()
func (*SpriteImpl) PenUp ¶ added in v1.1.0
func (p *SpriteImpl) PenUp()
func (*SpriteImpl) PrevCostume ¶ added in v1.1.0
func (p *SpriteImpl) PrevCostume()
func (*SpriteImpl) Quote__0 ¶ added in v1.1.0
func (p *SpriteImpl) Quote__0(message string)
func (*SpriteImpl) Quote__1 ¶ added in v1.1.0
func (p *SpriteImpl) Quote__1(message string, secs float64)
func (*SpriteImpl) Quote__2 ¶ added in v1.1.0
func (p *SpriteImpl) Quote__2(message, description string)
func (*SpriteImpl) Quote__3 ¶ added in v1.1.0
func (p *SpriteImpl) Quote__3(message, description string, secs float64)
func (*SpriteImpl) Say__0 ¶ added in v1.1.0
func (p *SpriteImpl) Say__0(msg interface{})
func (*SpriteImpl) Say__1 ¶ added in v1.1.0
func (p *SpriteImpl) Say__1(msg interface{}, secs float64)
func (*SpriteImpl) SetCostume__0 ¶ added in v1.1.0
func (p *SpriteImpl) SetCostume__0(costume SpriteCostumeName)
func (*SpriteImpl) SetCostume__1 ¶ added in v1.1.0
func (p *SpriteImpl) SetCostume__1(index float64)
func (*SpriteImpl) SetCostume__2 ¶ added in v1.1.0
func (p *SpriteImpl) SetCostume__2(index int)
func (*SpriteImpl) SetCostume__3 ¶ added in v1.1.0
func (p *SpriteImpl) SetCostume__3(action switchAction)
func (*SpriteImpl) SetDying ¶ added in v1.1.0
func (p *SpriteImpl) SetDying()
func (*SpriteImpl) SetEffect ¶ added in v1.1.0
func (p *SpriteImpl) SetEffect(kind EffectKind, val float64)
func (*SpriteImpl) SetHeading ¶ added in v1.1.0
func (p *SpriteImpl) SetHeading(dir float64)
func (*SpriteImpl) SetPenColor ¶ added in v1.1.0
func (p *SpriteImpl) SetPenColor(color Color)
func (*SpriteImpl) SetPenHue ¶ added in v1.1.0
func (p *SpriteImpl) SetPenHue(hue float64)
func (*SpriteImpl) SetPenShade ¶ added in v1.1.0
func (p *SpriteImpl) SetPenShade(shade float64)
func (*SpriteImpl) SetPenSize ¶ added in v1.1.0
func (p *SpriteImpl) SetPenSize(size float64)
func (*SpriteImpl) SetRotationStyle ¶ added in v1.1.0
func (p *SpriteImpl) SetRotationStyle(style RotationStyle)
func (*SpriteImpl) SetSize ¶ added in v1.1.0
func (p *SpriteImpl) SetSize(size float64)
func (*SpriteImpl) SetXYpos ¶ added in v1.1.0
func (p *SpriteImpl) SetXYpos(x, y float64)
func (*SpriteImpl) SetXpos ¶ added in v1.1.0
func (p *SpriteImpl) SetXpos(x float64)
func (*SpriteImpl) SetYpos ¶ added in v1.1.0
func (p *SpriteImpl) SetYpos(y float64)
func (*SpriteImpl) Show ¶ added in v1.1.0
func (p *SpriteImpl) Show()
func (*SpriteImpl) ShowVar ¶ added in v1.1.0
func (p *SpriteImpl) ShowVar(name string)
func (*SpriteImpl) Size ¶ added in v1.1.0
func (p *SpriteImpl) Size() float64
func (*SpriteImpl) Stamp ¶ added in v1.1.0
func (p *SpriteImpl) Stamp()
func (*SpriteImpl) Step__0 ¶ added in v1.1.0
func (p *SpriteImpl) Step__0(step float64)
func (*SpriteImpl) Step__1 ¶ added in v1.1.0
func (p *SpriteImpl) Step__1(step float64, animation SpriteAnimationName)
func (*SpriteImpl) Step__2 ¶ added in v1.1.0
func (p *SpriteImpl) Step__2(step int)
func (*SpriteImpl) Think__0 ¶ added in v1.1.0
func (p *SpriteImpl) Think__0(msg interface{})
func (*SpriteImpl) Think__1 ¶ added in v1.1.0
func (p *SpriteImpl) Think__1(msg interface{}, secs float64)
func (*SpriteImpl) TouchingColor ¶ added in v1.1.0
func (p *SpriteImpl) TouchingColor(color Color) bool
func (*SpriteImpl) Touching__0 ¶ added in v1.1.0
func (p *SpriteImpl) Touching__0(sprite SpriteName) bool
func (*SpriteImpl) Touching__1 ¶ added in v1.1.0
func (p *SpriteImpl) Touching__1(sprite Sprite) bool
func (*SpriteImpl) Touching__2 ¶ added in v1.1.0
func (p *SpriteImpl) Touching__2(obj specialObj) bool
func (*SpriteImpl) TurnTo__0 ¶ added in v1.1.0
func (p *SpriteImpl) TurnTo__0(sprite Sprite)
func (*SpriteImpl) TurnTo__1 ¶ added in v1.1.0
func (p *SpriteImpl) TurnTo__1(sprite SpriteName)
func (*SpriteImpl) TurnTo__2 ¶ added in v1.1.0
func (p *SpriteImpl) TurnTo__2(degree float64)
func (*SpriteImpl) TurnTo__3 ¶ added in v1.1.0
func (p *SpriteImpl) TurnTo__3(dir specialDir)
func (*SpriteImpl) TurnTo__4 ¶ added in v1.1.0
func (p *SpriteImpl) TurnTo__4(obj specialObj)
func (*SpriteImpl) Turn__0 ¶ added in v1.1.0
func (p *SpriteImpl) Turn__0(degree float64)
func (*SpriteImpl) Turn__1 ¶ added in v1.1.0
func (p *SpriteImpl) Turn__1(dir specialDir)
func (*SpriteImpl) Turn__2 ¶ added in v1.1.0
func (p *SpriteImpl) Turn__2(ti *TurningInfo)
func (*SpriteImpl) Visible ¶ added in v1.1.0
func (p *SpriteImpl) Visible() bool
func (*SpriteImpl) Xpos ¶ added in v1.1.0
func (p *SpriteImpl) Xpos() float64
func (*SpriteImpl) Ypos ¶ added in v1.1.0
func (p *SpriteImpl) Ypos() float64
type SpriteName ¶ added in v1.1.0
type SpriteName = string
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
type TurningInfo struct {
OldDir float64
NewDir float64
Obj *SpriteImpl
}
func (*TurningInfo) Dir ¶ added in v1.0.0
func (p *TurningInfo) Dir() float64
type Widget ¶ added in v1.1.0
type Widget interface {
GetName() WidgetName
Visible() bool
Show()
Hide()
Xpos() float64
Ypos() float64
SetXpos(x float64)
SetYpos(y float64)
SetXYpos(x float64, y float64)
ChangeXpos(dx float64)
ChangeYpos(dy float64)
ChangeXYpos(dx float64, dy float64)
Size() float64
SetSize(size float64)
ChangeSize(delta float64)
}
func GetWidget_ ¶ added in v1.1.0
func GetWidget_(sg ShapeGetter, name WidgetName) Widget
GetWidget_ returns the widget instance with given name. It panics if not found. Instead of being used directly, it is meant to be called by `Gopt_Game_Gopx_GetWidget` only. We extract `GetWidget_` to keep `Gopt_Game_Gopx_GetWidget` simple, which simplifies work in ispx, see details in https://github.com/goplus/builder/issues/765#issuecomment-2313915805.
type WidgetName ¶ added in v1.1.0
type WidgetName = string



