Documentation
¶
Index ¶
- Constants
- func Exit__0(code int)
- func Exit__1()
- func Forever(call func())
- func Iround(v float64) int
- func Rand__0(from, to int) float64
- func Rand__1(from, to float64) float64
- func Repeat(loopCount int, call func())
- func RepeatUntil(condition func() bool, call func())
- func Sched() int
- func SchedNow() int
- func SetDebug(flags dbgFlags)
- func WaitUntil(condition func() bool)
- func XGot_Game_Main(game Gamer, sprites ...Sprite)
- func XGot_Game_Reload(game Gamer, index any) (err error)
- func XGot_Game_Run(game Gamer, resource any, gameConf ...*Config)
- func XGot_Game_XGox_GetWidget[T any](sg ShapeGetter, name WidgetName) *T
- func XGot_SpriteImpl_Clone__0(sprite Sprite)
- func XGot_SpriteImpl_Clone__1(sprite Sprite, data any)
- type BackdropName
- type Camera
- type ColliderShapeType
- type Color
- type Config
- type DecoratorJSON
- type Direction
- type EffectKind
- type Game
- func (p *Game) Answer() string
- func (p *Game) Ask(msg any)
- func (p *Game) BackdropIndex() int
- func (p *Game) BackdropName() string
- func (p *Game) BroadcastAndWait__0(msg string)
- func (p *Game) BroadcastAndWait__1(msg string, data any)
- func (p *Game) Broadcast__0(msg string)
- func (p *Game) Broadcast__1(msg string, data any)
- func (p *Game) ChangeGraphicEffect(kind EffectKind, delta float64)
- func (p *Game) ChangeSoundEffect(kind SoundEffectKind, delta float64)
- func (p *Game) ChangeVolume(delta float64)
- func (p *Game) ClearGraphicEffects()
- func (p *Game) ClearSoundEffects()
- func (p *Game) DebugDrawCircle(posX, posY, radius float64, color Color)
- func (p *Game) DebugDrawLine(fromX, fromY, toX, toY float64, color Color)
- func (p *Game) DebugDrawLines(points []float64, color Color)
- func (p *Game) DebugDrawRect(posX, posY, width, height float64, color Color)
- func (p *Game) EraseAll()
- func (p *Game) EraseTile__0(x, y float64)
- func (p *Game) EraseTile__1(x, y float64, layerIndex int64)
- func (p *Game) FindPath__0(x_from, y_from, x_to, y_to float64) []float64
- func (p *Game) FindPath__1(x_from, y_from, x_to, y_to float64, with_debug bool) []float64
- func (p *Game) FindPath__2(x_from, y_from, x_to, y_to float64, with_debug, with_jump bool) []float64
- func (p *Game) GetSoundEffect(kind SoundEffectKind) float64
- func (p *Game) GetTile__0(x, y float64) string
- func (p *Game) GetTile__1(x, y float64, layerIndex int64) string
- func (p *Game) HideVar(name string)
- func (p *Game) IntersectCircle(posX, posY, radius float64) []Sprite
- func (p *Game) IntersectRect(posX, posY, width, height float64) []Sprite
- func (p *Game) KeyPressed(key Key) bool
- func (p *Game) LoadTilemap(mapDir string)
- func (p *Game) Loudness() float64
- func (p *Game) MousePressed() bool
- func (p *Game) MouseX() float64
- func (p *Game) MouseY() float64
- 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) OnEngineDestroy()
- func (p *Game) OnEnginePause(isPaused bool)
- func (p *Game) OnEngineRender(delta float64)
- func (p *Game) OnEngineReset()
- func (p *Game) OnEngineStart()
- func (p *Game) OnEngineUpdate(delta float64)
- 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 any))
- func (p *Game) OnMsg__1(msg string, onMsg func())
- func (p *Game) OnStart(onStart func())
- func (p *Game) OnSwipe__0(direction Direction, onSwipe func())
- func (p *Game) OnTimer(time float64, call func())
- func (p *Game) PausePlaying(name SoundName)
- func (p *Game) PlaceTile(x, y float64, texturePath string)
- func (p *Game) PlaceTiles__0(positions []float64, texturePath string)
- func (p *Game) PlaceTiles__1(positions []float64, texturePath string, layerIndex int64)
- func (p *Game) PlayAndWait(name SoundName)
- func (p *Game) Play__0(name SoundName, loop bool)
- func (p *Game) Play__1(name SoundName)
- func (p *Game) Raycast__0(fromX, fromY, toX, toY float64, ignoreSprites []Sprite) (hit bool, sprite Sprite, hitX, hitY float64)
- func (p *Game) Raycast__1(fromX, fromY, toX, toY float64, ignoreSprite Sprite) (hit bool, sprite Sprite, hitX, hitY float64)
- func (p *Game) Raycast__2(fromX, fromY, toX, toY float64) (hit bool, sprite Sprite, hitX, hitY float64)
- func (p *Game) ResetTimer()
- func (p *Game) ResumePlaying(name SoundName)
- func (p *Game) SetBackdropAndWait__0(backdrop BackdropName)
- func (p *Game) SetBackdropAndWait__1(index float64)
- func (p *Game) SetBackdropAndWait__2(index int)
- func (p *Game) SetBackdropAndWait__3(action switchAction)
- func (p *Game) SetBackdrop__0(backdrop BackdropName)
- func (p *Game) SetBackdrop__1(index float64)
- func (p *Game) SetBackdrop__2(index int)
- func (p *Game) SetBackdrop__3(action switchAction)
- func (p *Game) SetGraphicEffect(kind EffectKind, val float64)
- func (p *Game) SetSoundEffect(kind SoundEffectKind, value float64)
- func (p *Game) SetVolume(volume float64)
- func (p *Game) SetWindowSize(width int64, height int64)
- func (p *Game) SetupPathFinder__0()
- func (p *Game) SetupPathFinder__1(x_grid_size, y_grid_size, x_cell_size, y_cell_size float64, ...)
- func (p *Game) ShowVar(name string)
- func (p *Game) Stop(kind StopKind)
- func (p *Game) StopAllSounds()
- func (p *Game) StopPlaying(name SoundName)
- func (p *Game) TilemapName() string
- func (p *Game) Timer() float64
- func (p *Game) UnloadTilemap()
- func (p *Game) Username() string
- func (p *Game) Volume() float64
- func (p *Game) Wait(secs float64)
- func (p *Game) WaitNextFrame() 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) Clear()
- func (p *List) Contains(v obj) bool
- func (p *List) Delete(i Pos)
- func (p *List) IndexOf(v obj) 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 PenColorParam
- type PhysicsMode
- type Pos
- type RotationStyle
- type Shape
- type ShapeGetter
- type SoundEffectKind
- type SoundName
- type SpatialHash
- type Sprite
- type SpriteAABB
- type SpriteAnimationName
- type SpriteCostumeName
- type SpriteImpl
- func (p *SpriteImpl) AddImpulse(impulseX, impulseY float64)
- func (p *SpriteImpl) AnimateAndWait(name SpriteAnimationName)
- func (p *SpriteImpl) Animate__0(name SpriteAnimationName)
- func (p *SpriteImpl) Animate__1(name SpriteAnimationName, loop bool)
- func (p *SpriteImpl) Ask(msg any)
- func (p *SpriteImpl) BounceOffEdge()
- func (p *SpriteImpl) ChangeGraphicEffect(kind EffectKind, delta float64)
- func (p *SpriteImpl) ChangeHeading(dir Direction)
- func (p *SpriteImpl) ChangePenColor(kind PenColorParam, delta float64)
- func (p *SpriteImpl) ChangePenSize(delta float64)
- func (p *SpriteImpl) ChangeSize(delta float64)
- func (p *SpriteImpl) ChangeSoundEffect(kind SoundEffectKind, delta float64)
- func (p *SpriteImpl) ChangeVolume(delta float64)
- func (p *SpriteImpl) ChangeXYpos(dx, dy float64)
- func (p *SpriteImpl) ChangeXpos(dx float64)
- func (p *SpriteImpl) ChangeYpos(dy float64)
- func (p *SpriteImpl) ClearGraphicEffects()
- func (p *SpriteImpl) ColliderPivot(isTrigger bool) (offsetX, offsetY float64)
- func (p *SpriteImpl) ColliderShape(isTrigger bool) (ColliderShapeType, []float64)
- func (p *SpriteImpl) CollisionEnabled() bool
- func (p *SpriteImpl) CollisionLayer() int64
- func (p *SpriteImpl) CollisionMask() int64
- func (p *SpriteImpl) CostumeIndex() int
- func (p *SpriteImpl) CostumeName() SpriteCostumeName
- func (p *SpriteImpl) DeleteThisClone()
- func (pself *SpriteImpl) DeltaTime() float64
- 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) GetSoundEffect(kind SoundEffectKind) 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) Gravity() float64
- func (p *SpriteImpl) Heading() Direction
- func (p *SpriteImpl) Hide()
- func (p *SpriteImpl) HideVar(name string)
- func (p *SpriteImpl) InitFrom(src *SpriteImpl)
- func (p *SpriteImpl) IsCloned() bool
- func (p *SpriteImpl) IsOnFloor() bool
- func (p *SpriteImpl) Move__0(step float64)
- func (p *SpriteImpl) Move__1(step int)
- func (p *SpriteImpl) Name() string
- 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 any))
- 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) OnMsg__0(onMsg func(msg string, data any))
- func (p *SpriteImpl) OnMsg__1(msg string, onMsg func())
- func (p *SpriteImpl) OnStart(onStart func())
- func (p *SpriteImpl) OnSwipe__0(direction Direction, onSwipe func())
- func (p *SpriteImpl) OnTimer(time float64, call func())
- func (p *SpriteImpl) OnTouchStart__0(sprite SpriteName, onTouchStart func(Sprite))
- func (p *SpriteImpl) OnTouchStart__1(sprite SpriteName, onTouchStart func())
- func (p *SpriteImpl) OnTouchStart__2(sprites []SpriteName, onTouchStart func(Sprite))
- func (p *SpriteImpl) OnTouchStart__3(sprites []SpriteName, onTouchStart func())
- func (p *SpriteImpl) PausePlaying(name SoundName)
- func (p *SpriteImpl) PenDown()
- func (p *SpriteImpl) PenUp()
- func (p *SpriteImpl) PhysicsMode() PhysicsMode
- func (p *SpriteImpl) PlayAndWait(name SoundName)
- func (p *SpriteImpl) Play__0(name SoundName, loop bool)
- func (p *SpriteImpl) Play__1(name SoundName)
- 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) ResumePlaying(name SoundName)
- func (p *SpriteImpl) Say__0(msg any)
- func (p *SpriteImpl) Say__1(msg any, secs float64)
- func (p *SpriteImpl) SetColliderPivot(isTrigger bool, offsetX, offsetY float64)
- func (p *SpriteImpl) SetColliderShape(isTrigger bool, ctype ColliderShapeType, params []float64) error
- func (p *SpriteImpl) SetCollisionEnabled(enabled bool)
- func (p *SpriteImpl) SetCollisionLayer(layer int64)
- func (p *SpriteImpl) SetCollisionMask(mask int64)
- 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) SetGraphicEffect(kind EffectKind, val float64)
- func (p *SpriteImpl) SetGravity(gravity float64)
- func (p *SpriteImpl) SetHeading(dir Direction)
- func (p *SpriteImpl) SetLayer__0(layer layerAction)
- func (p *SpriteImpl) SetLayer__1(dir dirAction, delta int)
- func (p *SpriteImpl) SetPenColor__0(color Color)
- func (p *SpriteImpl) SetPenColor__1(kind PenColorParam, value float64)
- func (p *SpriteImpl) SetPenSize(size float64)
- func (p *SpriteImpl) SetPhysicsMode(mode PhysicsMode)
- func (p *SpriteImpl) SetRotationStyle(style RotationStyle)
- func (p *SpriteImpl) SetSize(size float64)
- func (p *SpriteImpl) SetSoundEffect(kind SoundEffectKind, value float64)
- func (p *SpriteImpl) SetTriggerEnabled(trigger bool)
- func (p *SpriteImpl) SetTriggerLayer(layer int64)
- func (p *SpriteImpl) SetTriggerMask(mask int64)
- func (p *SpriteImpl) SetVelocity(velocityX, velocityY float64)
- func (p *SpriteImpl) SetVolume(volume 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) StepTo__0(sprite Sprite)
- func (p *SpriteImpl) StepTo__1(sprite SpriteName)
- func (p *SpriteImpl) StepTo__2(x, y float64)
- func (p *SpriteImpl) StepTo__3(obj specialObj)
- func (p *SpriteImpl) StepTo__4(sprite Sprite, speed float64)
- func (p *SpriteImpl) StepTo__5(sprite SpriteName, speed float64)
- func (p *SpriteImpl) StepTo__6(x, y, speed float64)
- func (p *SpriteImpl) StepTo__7(obj specialObj, speed float64)
- func (p *SpriteImpl) StepTo__8(sprite Sprite, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) StepTo__9(sprite SpriteName, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) StepTo__a(x, y, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) StepTo__b(obj specialObj, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) Step__0(step float64)
- func (p *SpriteImpl) Step__1(step float64, speed float64)
- func (p *SpriteImpl) Step__2(step float64, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) Stop(kind StopKind)
- func (p *SpriteImpl) StopAnimation(name SpriteAnimationName)
- func (p *SpriteImpl) StopPlaying(name SoundName)
- func (p *SpriteImpl) Think__0(msg any)
- func (p *SpriteImpl) Think__1(msg any, secs float64)
- func (pself *SpriteImpl) TimeSinceLevelLoad() 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) TriggerEnabled() bool
- func (p *SpriteImpl) TriggerLayer() int64
- func (p *SpriteImpl) TriggerMask() int64
- func (p *SpriteImpl) TurnTo__0(target Sprite)
- func (p *SpriteImpl) TurnTo__1(target SpriteName)
- func (p *SpriteImpl) TurnTo__2(dir Direction)
- func (p *SpriteImpl) TurnTo__3(target specialObj)
- func (p *SpriteImpl) TurnTo__4(target Sprite, speed float64)
- func (p *SpriteImpl) TurnTo__5(target SpriteName, speed float64)
- func (p *SpriteImpl) TurnTo__6(dir Direction, speed float64)
- func (p *SpriteImpl) TurnTo__7(target specialObj, speed float64)
- func (p *SpriteImpl) TurnTo__8(target Sprite, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) TurnTo__9(target SpriteName, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) TurnTo__a(dir Direction, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) TurnTo__b(target specialObj, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) Turn__0(dir Direction)
- func (p *SpriteImpl) Turn__1(dir Direction, speed float64)
- func (p *SpriteImpl) Turn__2(dir Direction, speed float64, animation SpriteAnimationName)
- func (p *SpriteImpl) Velocity() (velocityX, velocityY float64)
- func (p *SpriteImpl) Visible() bool
- func (p *SpriteImpl) Volume() float64
- func (p *SpriteImpl) Xpos() float64
- func (p *SpriteImpl) Ypos() float64
- type SpriteName
- type StopKind
- 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 ( MOUSE_BUTTON_LEFT int64 = 1 MOUSE_BUTTON_RIGHT int64 = 2 MOUSE_BUTTON_MIDDLE int64 = 3 )
const ( Prev switchAction = -1 Next switchAction = 1 )
const ( Front layerAction = -1 Back layerAction = 1 )
const ( Forward dirAction = -1 Backward dirAction = 1 )
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" )
const ( RectCollider ColliderShapeType = ColliderShapeType(physicsColliderRect) CircleCollider ColliderShapeType = ColliderShapeType(physicsColliderCircle) CapsuleCollider ColliderShapeType = ColliderShapeType(physicsColliderCapsule) PolygonCollider ColliderShapeType = ColliderShapeType(physicsColliderPolygon) TriggerExtraPixel float64 = 2.0 )
Variables ¶
This section is empty.
Functions ¶
func Repeat ¶
func Repeat(loopCount int, call func())
Repeat executes a function for a specified number of times
func RepeatUntil ¶
func RepeatUntil(condition func() bool, call func())
RepeatUntil executes a function until a condition is met
func XGot_Game_Main ¶
XGot_Game_Main is required by XGo compiler as the entry of a .gmx project.
func XGot_Game_Reload ¶
XGot_Game_Reload reloads the game with new configuration
func XGot_Game_Run ¶
XGot_Game_Run runs the game using the builder pattern
func XGot_Game_XGox_GetWidget ¶
func XGot_Game_XGox_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 XGot_SpriteImpl_Clone__0 ¶
func XGot_SpriteImpl_Clone__0(sprite Sprite)
Types ¶
type BackdropName ¶
type BackdropName = string
type ColliderShapeType ¶
type ColliderShapeType = int64
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
Color represents an RGBA color.
type Config ¶
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
EventQueuePolicy string `json:"eventQueuePolicy,omitempty"`
Index any `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 DecoratorJSON ¶
type DecoratorJSON struct {
Version int `json:"version"`
Decorators []tm.DecoratorNode `json:"decorators"`
}
DecoratorJSON represents the structure of decorator.json file (new format).
type EffectKind ¶
type EffectKind int
const ( ColorEffect EffectKind = iota FishEyeEffect WhirlEffect PixelateEffect MosaicEffect BrightnessEffect GhostEffect )
func (EffectKind) String ¶
func (kind EffectKind) String() string
type Game ¶
type Game struct {
Camera Camera
// contains filtered or unexported fields
}
Game represents the main game instance with all core systems
func (*Game) BackdropIndex ¶
func (*Game) BackdropName ¶
func (*Game) BroadcastAndWait__0 ¶
func (*Game) BroadcastAndWait__1 ¶
func (*Game) Broadcast__0 ¶
func (*Game) Broadcast__1 ¶
func (*Game) ChangeGraphicEffect ¶
func (p *Game) ChangeGraphicEffect(kind EffectKind, delta float64)
func (*Game) ChangeSoundEffect ¶
func (p *Game) ChangeSoundEffect(kind SoundEffectKind, delta float64)
func (*Game) ChangeVolume ¶
func (*Game) ClearGraphicEffects ¶
func (p *Game) ClearGraphicEffects()
func (*Game) ClearSoundEffects ¶
func (p *Game) ClearSoundEffects()
func (*Game) DebugDrawCircle ¶
DebugDrawCircle draws a debug circle
func (*Game) DebugDrawLine ¶
DebugDrawLine draws a debug line
func (*Game) DebugDrawLines ¶
DebugDrawLines draws multiple debug lines
func (*Game) DebugDrawRect ¶
DebugDrawRect draws a debug rectangle
func (*Game) EraseTile__0 ¶
EraseTile__0 erases a tile at the specified position using default layer.
func (*Game) EraseTile__1 ¶
EraseTile__1 erases a tile at the specified position on a specific layer.
func (*Game) FindPath__0 ¶
func (*Game) FindPath__1 ¶
func (*Game) FindPath__2 ¶
func (*Game) GetSoundEffect ¶
func (p *Game) GetSoundEffect(kind SoundEffectKind) float64
func (*Game) GetTile__0 ¶
GetTile__0 gets the tile texture path at the specified position using default layer.
func (*Game) GetTile__1 ¶
GetTile__1 gets the tile texture path at the specified position on a specific layer.
func (*Game) IntersectCircle ¶
IntersectCircle detects sprites intersecting with a circular area
func (*Game) IntersectRect ¶
IntersectRect detects sprites intersecting with a rectangular area
func (*Game) KeyPressed ¶
func (*Game) LoadTilemap ¶
LoadTilemap dynamically loads a tilemap from the specified path mapDir can be either:
- A directory path (new format): "tilemaps/map1" -> uses C++ TileMapParser
- A file path (old format): "tilemaps/map1.json" -> uses Go loader
This will unload any currently loaded tilemap before loading the new one.
func (*Game) MousePressed ¶
func (*Game) OnBackdrop__0 ¶
func (p *Game) OnBackdrop__0(onBackdrop func(name BackdropName))
func (*Game) OnBackdrop__1 ¶
func (p *Game) OnBackdrop__1(name BackdropName, onBackdrop func())
func (*Game) OnEngineDestroy ¶
func (p *Game) OnEngineDestroy()
func (*Game) OnEnginePause ¶
func (*Game) OnEngineRender ¶
func (*Game) OnEngineReset ¶
func (p *Game) OnEngineReset()
func (*Game) OnEngineStart ¶
func (p *Game) OnEngineStart()
func (*Game) OnEngineUpdate ¶
func (*Game) OnSwipe__0 ¶
func (p *Game) OnSwipe__0(direction Direction, onSwipe func())
func (*Game) PausePlaying ¶
func (*Game) PlaceTiles__0 ¶
PlaceTiles__0 places multiple tiles at specified positions using default layer.
func (*Game) PlaceTiles__1 ¶
PlaceTiles__1 places multiple tiles at specified positions on a specific layer.
func (*Game) PlayAndWait ¶
func (*Game) Raycast__0 ¶
func (p *Game) Raycast__0(fromX, fromY, toX, toY float64, ignoreSprites []Sprite) (hit bool, sprite Sprite, hitX, hitY float64)
Raycast__0 performs a raycast, ignoring specified sprites
func (*Game) Raycast__1 ¶
func (p *Game) Raycast__1(fromX, fromY, toX, toY float64, ignoreSprite Sprite) (hit bool, sprite Sprite, hitX, hitY float64)
Raycast__1 performs a raycast, ignoring a single sprite
func (*Game) Raycast__2 ¶
func (p *Game) Raycast__2(fromX, fromY, toX, toY float64) (hit bool, sprite Sprite, hitX, hitY float64)
Raycast__2 performs a raycast without ignoring any sprites
func (*Game) ResetTimer ¶
func (p *Game) ResetTimer()
func (*Game) ResumePlaying ¶
func (*Game) SetBackdropAndWait__0 ¶
func (p *Game) SetBackdropAndWait__0(backdrop BackdropName)
func (*Game) SetBackdropAndWait__1 ¶
func (*Game) SetBackdropAndWait__2 ¶
func (*Game) SetBackdropAndWait__3 ¶
func (p *Game) SetBackdropAndWait__3(action switchAction)
func (*Game) SetBackdrop__0 ¶
func (p *Game) SetBackdrop__0(backdrop BackdropName)
func (*Game) SetBackdrop__1 ¶
func (*Game) SetBackdrop__2 ¶
func (*Game) SetBackdrop__3 ¶
func (p *Game) SetBackdrop__3(action switchAction)
func (*Game) SetGraphicEffect ¶
func (p *Game) SetGraphicEffect(kind EffectKind, val float64)
func (*Game) SetSoundEffect ¶
func (p *Game) SetSoundEffect(kind SoundEffectKind, value float64)
func (*Game) SetWindowSize ¶
SetWindowSize sets the window size to the specified width and height.
func (*Game) SetupPathFinder__0 ¶
func (p *Game) SetupPathFinder__0()
func (*Game) SetupPathFinder__1 ¶
func (*Game) StopAllSounds ¶
func (p *Game) StopAllSounds()
func (*Game) StopPlaying ¶
func (*Game) TilemapName ¶
TilemapName returns the name of the currently loaded tilemap. Returns empty string if no tilemap is loaded.
func (*Game) UnloadTilemap ¶
func (p *Game) UnloadTilemap()
UnloadTilemap unloads the currently loaded tilemap and cleans up resources.
func (*Game) WaitNextFrame ¶
type IEventSinks ¶
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 any))
OnMsg__1(msg string, onMsg func())
OnStart(onStart func())
OnSwipe__0(direction Direction, onSwipe func())
OnTimer(time float64, onTimer func())
Stop(kind StopKind)
}
type Key ¶
const ( Key0 Key = gdx.Key0 Key1 Key = gdx.Key1 Key2 Key = gdx.Key2 Key3 Key = gdx.Key3 Key4 Key = gdx.Key4 Key5 Key = gdx.Key5 Key6 Key = gdx.Key6 Key7 Key = gdx.Key7 Key8 Key = gdx.Key8 Key9 Key = gdx.Key9 KeyA Key = gdx.KeyA KeyB Key = gdx.KeyB KeyC Key = gdx.KeyC KeyD Key = gdx.KeyD KeyE Key = gdx.KeyE KeyF Key = gdx.KeyF KeyG Key = gdx.KeyG KeyH Key = gdx.KeyH KeyI Key = gdx.KeyI KeyJ Key = gdx.KeyJ KeyK Key = gdx.KeyK KeyL Key = gdx.KeyL KeyM Key = gdx.KeyM KeyN Key = gdx.KeyN KeyO Key = gdx.KeyO KeyP Key = gdx.KeyP KeyQ Key = gdx.KeyQ KeyR Key = gdx.KeyR KeyS Key = gdx.KeyS KeyT Key = gdx.KeyT KeyU Key = gdx.KeyU KeyV Key = gdx.KeyV KeyW Key = gdx.KeyW KeyX Key = gdx.KeyX KeyY Key = gdx.KeyY KeyZ Key = gdx.KeyZ KeyApostrophe Key = gdx.KeyApostrophe KeyBackslash Key = gdx.KeyBackslash KeyBackspace Key = gdx.KeyBackspace KeyCapsLock Key = gdx.KeyCapsLock KeyComma Key = gdx.KeyComma KeyDelete Key = gdx.KeyDelete KeyDown Key = gdx.KeyDown KeyEnd Key = gdx.KeyEnd KeyEnter Key = gdx.KeyEnter KeyEqual Key = gdx.KeyEqual KeyEscape Key = gdx.KeyEscape KeyF1 Key = gdx.KeyF1 KeyF2 Key = gdx.KeyF2 KeyF3 Key = gdx.KeyF3 KeyF4 Key = gdx.KeyF4 KeyF5 Key = gdx.KeyF5 KeyF6 Key = gdx.KeyF6 KeyF7 Key = gdx.KeyF7 KeyF8 Key = gdx.KeyF8 KeyF9 Key = gdx.KeyF9 KeyF10 Key = gdx.KeyF10 KeyF11 Key = gdx.KeyF11 KeyF12 Key = gdx.KeyF12 KeyGraveAccent Key = gdx.KeyQuoteLeft KeyHome Key = gdx.KeyHome KeyInsert Key = gdx.KeyInsert KeyKP0 Key = gdx.KeyKP0 KeyKP1 Key = gdx.KeyKP1 KeyKP2 Key = gdx.KeyKP2 KeyKP3 Key = gdx.KeyKP3 KeyKP4 Key = gdx.KeyKP4 KeyKP5 Key = gdx.KeyKP5 KeyKP6 Key = gdx.KeyKP6 KeyKP7 Key = gdx.KeyKP7 KeyKP8 Key = gdx.KeyKP8 KeyKP9 Key = gdx.KeyKP9 KeyKPDecimal Key = gdx.KeyKPPeriod KeyKPDivide Key = gdx.KeyKPDivide KeyKPEnter Key = gdx.KeyKPEnter KeyKPEqual Key = gdx.KeyEqual KeyKPMultiply Key = gdx.KeyKPMultiply KeyKPSubtract Key = gdx.KeyKPSubtract KeyLeft Key = gdx.KeyLeft KeyLeftBracket Key = gdx.KeyBracketLeft KeyMenu Key = gdx.KeyMenu KeyMinus Key = gdx.KeyMinus KeyNumLock Key = gdx.KeyNumLock KeyPageDown Key = gdx.KeyPageDown KeyPageUp Key = gdx.KeyPageUp KeyPause Key = gdx.KeyPause KeyPeriod Key = gdx.KeyPeriod KeyPrintScreen Key = gdx.KeyPrint KeyRight Key = gdx.KeyRight KeyRightBracket Key = gdx.KeyBracketRight KeyScrollLock Key = gdx.KeyScrollLock KeySemicolon Key = gdx.KeySemicolon KeySlash Key = gdx.KeySlash KeySpace Key = gdx.KeySpace KeyTab Key = gdx.KeyTab KeyUp Key = gdx.KeyUp KeyAlt Key = gdx.KeyAlt KeyControl Key = gdx.KeyCmdOrCtrl KeyShift Key = gdx.KeyShift KeyMax Key = -2 KeyAny Key = -1 )
func KeyFromString ¶
KeyFromString converts a string to its corresponding KeyCode. It supports key names like "A", "Space", "Enter", "Left", etc. Returns KeyMax if the key name is not recognized.
type List ¶
type List struct {
// contains filtered or unexported fields
}
func NewList ¶
func NewList(l ...obj) List
NewList creates a new List initialized with the given elements.
func (*List) Append ¶
func (p *List) Append(v obj)
Append adds the element v to the end of the list.
func (*List) IndexOf ¶
IndexOf returns the zero-based position of the first occurrence of v in the list. Returns Invalid (-1) if v is not found.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor class.
func (*Monitor) ChangeSize ¶
func (*Monitor) ChangeXYpos ¶
func (*Monitor) ChangeXpos ¶
func (*Monitor) ChangeYpos ¶
func (*Monitor) GetName ¶
func (pself *Monitor) GetName() WidgetName
------------------------------------------------------------------------------------- IWidget
type PenColorParam ¶
type PenColorParam int
const ( PenHue PenColorParam = iota PenSaturation PenBrightness PenTransparency )
type PhysicsMode ¶
type PhysicsMode = int64
const ( NoPhysics PhysicsMode = 0 // Pure visual, no collision, best performance (current default) eg: decorators KinematicPhysics PhysicsMode = 1 // Code-controlled movement with collision detection eg: player DynamicPhysics PhysicsMode = 2 // Affected by physics, automatic gravity and collision eg: items StaticPhysics PhysicsMode = 3 // Static immovable, but has collision, affects other objects : eg: walls )
type RotationStyle ¶
type RotationStyle int
RotationStyle defines how a sprite rotates.
const ( None RotationStyle = iota Normal LeftRight )
type ShapeGetter ¶
type ShapeGetter interface {
// contains filtered or unexported methods
}
type SoundEffectKind ¶
type SoundEffectKind int
const ( SoundPanEffect SoundEffectKind = iota SoundPitchEffect )
type SpatialHash ¶
type SpatialHash struct {
// contains filtered or unexported fields
}
SpatialHash implements a simple spatial hash grid for broad-phase collision detection.
type Sprite ¶
type Sprite interface {
IEventSinks
Shape
// Core Methods
Main()
Name() string
IsCloned() bool
DeleteThisClone()
Destroy()
Die()
DeltaTime() float64
TimeSinceLevelLoad() float64
// Visibility Methods
Hide()
Show()
Visible() bool
HideVar(name string)
ShowVar(name string)
// Position Methods
Xpos() float64
Ypos() float64
SetXpos(x float64)
SetYpos(y float64)
SetXYpos(x, y float64)
ChangeXpos(dx float64)
ChangeYpos(dy float64)
ChangeXYpos(dx, dy float64)
// Movement Methods
Step__0(step float64)
Step__1(step float64, speed float64)
Step__2(step float64, speed float64, animation SpriteAnimationName)
StepTo__0(sprite Sprite)
StepTo__1(sprite SpriteName)
StepTo__2(x, y float64)
StepTo__3(obj specialObj)
StepTo__4(sprite Sprite, speed float64)
StepTo__5(sprite SpriteName, speed float64)
StepTo__6(x, y, speed float64)
StepTo__7(obj specialObj, speed float64)
StepTo__8(sprite Sprite, speed float64, animation SpriteAnimationName)
StepTo__9(sprite SpriteName, speed float64, animation SpriteAnimationName)
StepTo__a(x, y, speed float64, animation SpriteAnimationName)
StepTo__b(obj specialObj, speed float64, animation SpriteAnimationName)
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)
// Heading and Rotation Methods
Heading() Direction
SetHeading(dir Direction)
ChangeHeading(dir Direction)
SetRotationStyle(style RotationStyle)
Turn__0(dir Direction)
Turn__1(dir Direction, speed float64)
Turn__2(dir Direction, speed float64, animation SpriteAnimationName)
TurnTo__0(target Sprite)
TurnTo__1(target SpriteName)
TurnTo__2(dir Direction)
TurnTo__3(target specialObj)
TurnTo__4(target Sprite, speed float64)
TurnTo__5(target SpriteName, speed float64)
TurnTo__6(dir Direction, speed float64)
TurnTo__7(target specialObj, speed float64)
TurnTo__8(target Sprite, speed float64, animation SpriteAnimationName)
TurnTo__9(target SpriteName, speed float64, animation SpriteAnimationName)
TurnTo__a(dir Direction, speed float64, animation SpriteAnimationName)
TurnTo__b(target specialObj, speed float64, animation SpriteAnimationName)
BounceOffEdge()
// Size Methods
Size() float64
SetSize(size float64)
ChangeSize(delta float64)
// Layer Methods
SetLayer__0(layer layerAction)
SetLayer__1(dir dirAction, delta int)
// Costume Methods
CostumeName() SpriteCostumeName
CostumeIndex() int
SetCostume__0(costume SpriteCostumeName)
SetCostume__1(index float64)
SetCostume__2(index int)
SetCostume__3(action switchAction)
// Animation Methods
Animate__0(name SpriteAnimationName)
Animate__1(name SpriteAnimationName, loop bool)
AnimateAndWait(name SpriteAnimationName)
StopAnimation(name SpriteAnimationName)
// Graphic Effects Methods
SetGraphicEffect(kind EffectKind, val float64)
ChangeGraphicEffect(kind EffectKind, delta float64)
ClearGraphicEffects()
// Pen Methods
PenDown()
PenUp()
SetPenColor__0(color Color)
SetPenColor__1(kind PenColorParam, value float64)
ChangePenColor(kind PenColorParam, delta float64)
SetPenSize(size float64)
ChangePenSize(delta float64)
Stamp()
// Distance and Detection Methods
DistanceTo__0(sprite Sprite) float64
DistanceTo__1(sprite SpriteName) float64
DistanceTo__2(obj specialObj) float64
DistanceTo__3(pos Pos) float64
Touching__0(sprite SpriteName) bool
Touching__1(sprite Sprite) bool
Touching__2(obj specialObj) bool
TouchingColor(color Color) bool
// Communication Methods
Say__0(msg any)
Say__1(msg any, secs float64)
Think__0(msg any)
Think__1(msg any, secs float64)
Ask(msg any)
Quote__0(message string)
Quote__1(message string, secs float64)
Quote__2(message, description string)
Quote__3(message, description string, secs float64)
// Event Methods
OnCloned__0(onCloned func(data any))
OnCloned__1(onCloned func())
OnTouchStart__0(sprite SpriteName, onTouchStart func(Sprite))
OnTouchStart__1(sprite SpriteName, onTouchStart func())
OnTouchStart__2(sprites []SpriteName, onTouchStart func(Sprite))
OnTouchStart__3(sprites []SpriteName, onTouchStart func())
// Sound Methods
Volume() float64
SetVolume(volume float64)
ChangeVolume(delta float64)
GetSoundEffect(kind SoundEffectKind) float64
SetSoundEffect(kind SoundEffectKind, value float64)
ChangeSoundEffect(kind SoundEffectKind, delta float64)
Play__0(name SoundName, loop bool)
Play__1(name SoundName)
PlayAndWait(name SoundName)
PausePlaying(name SoundName)
ResumePlaying(name SoundName)
StopPlaying(name SoundName)
// Physics Methods
SetPhysicsMode(mode PhysicsMode)
PhysicsMode() PhysicsMode
SetVelocity(velocityX, velocityY float64)
Velocity() (velocityX, velocityY float64)
SetGravity(gravity float64)
Gravity() float64
AddImpulse(impulseX, impulseY float64)
IsOnFloor() bool
// Collider Methods
SetColliderShape(isTrigger bool, ctype ColliderShapeType, params []float64) error
ColliderShape(isTrigger bool) (ColliderShapeType, []float64)
SetColliderPivot(isTrigger bool, offsetX, offsetY float64)
ColliderPivot(isTrigger bool) (offsetX, offsetY float64)
// Collision Methods
SetCollisionLayer(layer int64)
SetCollisionMask(mask int64)
SetCollisionEnabled(enabled bool)
CollisionLayer() int64
CollisionMask() int64
CollisionEnabled() bool
// Trigger Methods
SetTriggerEnabled(trigger bool)
SetTriggerLayer(layer int64)
SetTriggerMask(mask int64)
TriggerLayer() int64
TriggerMask() int64
TriggerEnabled() bool
}
Sprite defines the interface for all sprite objects in the game
type SpriteAABB ¶
type SpriteAABB struct {
// contains filtered or unexported fields
}
SpriteAABB represents an axis-aligned bounding box for a sprite.
type SpriteAnimationName ¶
type SpriteAnimationName = string
Type aliases for sprite-related identifiers.
type SpriteCostumeName ¶
type SpriteCostumeName = string
Type aliases for sprite-related identifiers.
type SpriteImpl ¶
type SpriteImpl struct {
// contains filtered or unexported fields
}
SpriteImpl is the concrete implementation of the Sprite interface
func (*SpriteImpl) AddImpulse ¶
func (p *SpriteImpl) AddImpulse(impulseX, impulseY float64)
func (*SpriteImpl) AnimateAndWait ¶
func (p *SpriteImpl) AnimateAndWait(name SpriteAnimationName)
func (*SpriteImpl) Animate__0 ¶
func (p *SpriteImpl) Animate__0(name SpriteAnimationName)
func (*SpriteImpl) Animate__1 ¶
func (p *SpriteImpl) Animate__1(name SpriteAnimationName, loop bool)
func (*SpriteImpl) Ask ¶
func (p *SpriteImpl) Ask(msg any)
func (*SpriteImpl) BounceOffEdge ¶
func (p *SpriteImpl) BounceOffEdge()
func (*SpriteImpl) ChangeGraphicEffect ¶
func (p *SpriteImpl) ChangeGraphicEffect(kind EffectKind, delta float64)
func (*SpriteImpl) ChangeHeading ¶
func (p *SpriteImpl) ChangeHeading(dir Direction)
func (*SpriteImpl) ChangePenColor ¶
func (p *SpriteImpl) ChangePenColor(kind PenColorParam, delta float64)
func (*SpriteImpl) ChangePenSize ¶
func (p *SpriteImpl) ChangePenSize(delta float64)
func (*SpriteImpl) ChangeSize ¶
func (p *SpriteImpl) ChangeSize(delta float64)
func (*SpriteImpl) ChangeSoundEffect ¶
func (p *SpriteImpl) ChangeSoundEffect(kind SoundEffectKind, delta float64)
func (*SpriteImpl) ChangeVolume ¶
func (p *SpriteImpl) ChangeVolume(delta float64)
func (*SpriteImpl) ChangeXYpos ¶
func (p *SpriteImpl) ChangeXYpos(dx, dy float64)
func (*SpriteImpl) ChangeXpos ¶
func (p *SpriteImpl) ChangeXpos(dx float64)
func (*SpriteImpl) ChangeYpos ¶
func (p *SpriteImpl) ChangeYpos(dy float64)
func (*SpriteImpl) ClearGraphicEffects ¶
func (p *SpriteImpl) ClearGraphicEffects()
func (*SpriteImpl) ColliderPivot ¶
func (p *SpriteImpl) ColliderPivot(isTrigger bool) (offsetX, offsetY float64)
func (*SpriteImpl) ColliderShape ¶
func (p *SpriteImpl) ColliderShape(isTrigger bool) (ColliderShapeType, []float64)
func (*SpriteImpl) CollisionEnabled ¶
func (p *SpriteImpl) CollisionEnabled() bool
func (*SpriteImpl) CollisionLayer ¶
func (p *SpriteImpl) CollisionLayer() int64
func (*SpriteImpl) CollisionMask ¶
func (p *SpriteImpl) CollisionMask() int64
func (*SpriteImpl) CostumeIndex ¶
func (p *SpriteImpl) CostumeIndex() int
func (*SpriteImpl) CostumeName ¶
func (p *SpriteImpl) CostumeName() SpriteCostumeName
func (*SpriteImpl) DeleteThisClone ¶
func (p *SpriteImpl) DeleteThisClone()
DeleteThisClone deletes only cloned sprite, no effect on prototype sprite. Add this interface to match Scratch.
func (*SpriteImpl) DeltaTime ¶
func (pself *SpriteImpl) DeltaTime() float64
func (*SpriteImpl) Destroy ¶
func (p *SpriteImpl) Destroy()
func (*SpriteImpl) Die ¶
func (p *SpriteImpl) Die()
func (*SpriteImpl) DistanceTo__0 ¶
func (p *SpriteImpl) DistanceTo__0(sprite Sprite) float64
DistanceTo func:
DistanceTo(sprite) DistanceTo(spx.Mouse) DistanceTo(spx.Random)
func (*SpriteImpl) DistanceTo__1 ¶
func (p *SpriteImpl) DistanceTo__1(sprite SpriteName) float64
func (*SpriteImpl) DistanceTo__2 ¶
func (p *SpriteImpl) DistanceTo__2(obj specialObj) float64
func (*SpriteImpl) DistanceTo__3 ¶
func (p *SpriteImpl) DistanceTo__3(pos Pos) float64
func (*SpriteImpl) GetSoundEffect ¶
func (p *SpriteImpl) GetSoundEffect(kind SoundEffectKind) float64
func (*SpriteImpl) Glide__0 ¶
func (p *SpriteImpl) Glide__0(x, y float64, secs float64)
func (*SpriteImpl) Glide__1 ¶
func (p *SpriteImpl) Glide__1(sprite Sprite, secs float64)
func (*SpriteImpl) Glide__2 ¶
func (p *SpriteImpl) Glide__2(sprite SpriteName, secs float64)
func (*SpriteImpl) Glide__3 ¶
func (p *SpriteImpl) Glide__3(obj specialObj, secs float64)
func (*SpriteImpl) Glide__4 ¶
func (p *SpriteImpl) Glide__4(pos Pos, secs float64)
func (*SpriteImpl) Gravity ¶
func (p *SpriteImpl) Gravity() float64
func (*SpriteImpl) Heading ¶
func (p *SpriteImpl) Heading() Direction
func (*SpriteImpl) Hide ¶
func (p *SpriteImpl) Hide()
func (*SpriteImpl) HideVar ¶
func (p *SpriteImpl) HideVar(name string)
func (*SpriteImpl) InitFrom ¶
func (p *SpriteImpl) InitFrom(src *SpriteImpl)
func (*SpriteImpl) IsCloned ¶
func (p *SpriteImpl) IsCloned() bool
func (*SpriteImpl) IsOnFloor ¶
func (p *SpriteImpl) IsOnFloor() bool
func (*SpriteImpl) Move__0 ¶
func (p *SpriteImpl) Move__0(step float64)
func (*SpriteImpl) Move__1 ¶
func (p *SpriteImpl) Move__1(step int)
func (*SpriteImpl) Name ¶
func (p *SpriteImpl) Name() string
func (*SpriteImpl) OnBackdrop__0 ¶
func (p *SpriteImpl) OnBackdrop__0(onBackdrop func(name BackdropName))
func (*SpriteImpl) OnBackdrop__1 ¶
func (p *SpriteImpl) OnBackdrop__1(name BackdropName, onBackdrop func())
func (*SpriteImpl) OnCloned__0 ¶
func (p *SpriteImpl) OnCloned__0(onCloned func(data any))
func (*SpriteImpl) OnCloned__1 ¶
func (p *SpriteImpl) OnCloned__1(onCloned func())
func (*SpriteImpl) OnSwipe__0 ¶
func (p *SpriteImpl) OnSwipe__0(direction Direction, onSwipe func())
func (*SpriteImpl) OnTouchStart__0 ¶
func (p *SpriteImpl) OnTouchStart__0(sprite SpriteName, onTouchStart func(Sprite))
func (*SpriteImpl) OnTouchStart__1 ¶
func (p *SpriteImpl) OnTouchStart__1(sprite SpriteName, onTouchStart func())
func (*SpriteImpl) OnTouchStart__2 ¶
func (p *SpriteImpl) OnTouchStart__2(sprites []SpriteName, onTouchStart func(Sprite))
func (*SpriteImpl) OnTouchStart__3 ¶
func (p *SpriteImpl) OnTouchStart__3(sprites []SpriteName, onTouchStart func())
func (*SpriteImpl) PausePlaying ¶
func (p *SpriteImpl) PausePlaying(name SoundName)
func (*SpriteImpl) PenDown ¶
func (p *SpriteImpl) PenDown()
func (*SpriteImpl) PenUp ¶
func (p *SpriteImpl) PenUp()
func (*SpriteImpl) PhysicsMode ¶
func (p *SpriteImpl) PhysicsMode() PhysicsMode
func (*SpriteImpl) PlayAndWait ¶
func (p *SpriteImpl) PlayAndWait(name SoundName)
func (*SpriteImpl) Play__0 ¶
func (p *SpriteImpl) Play__0(name SoundName, loop bool)
func (*SpriteImpl) Play__1 ¶
func (p *SpriteImpl) Play__1(name SoundName)
func (*SpriteImpl) Quote__0 ¶
func (p *SpriteImpl) Quote__0(message string)
func (*SpriteImpl) Quote__1 ¶
func (p *SpriteImpl) Quote__1(message string, secs float64)
func (*SpriteImpl) Quote__2 ¶
func (p *SpriteImpl) Quote__2(message, description string)
func (*SpriteImpl) Quote__3 ¶
func (p *SpriteImpl) Quote__3(message, description string, secs float64)
func (*SpriteImpl) ResumePlaying ¶
func (p *SpriteImpl) ResumePlaying(name SoundName)
func (*SpriteImpl) Say__0 ¶
func (p *SpriteImpl) Say__0(msg any)
func (*SpriteImpl) Say__1 ¶
func (p *SpriteImpl) Say__1(msg any, secs float64)
func (*SpriteImpl) SetColliderPivot ¶
func (p *SpriteImpl) SetColliderPivot(isTrigger bool, offsetX, offsetY float64)
func (*SpriteImpl) SetColliderShape ¶
func (p *SpriteImpl) SetColliderShape(isTrigger bool, ctype ColliderShapeType, params []float64) error
func (*SpriteImpl) SetCollisionEnabled ¶
func (p *SpriteImpl) SetCollisionEnabled(enabled bool)
func (*SpriteImpl) SetCollisionLayer ¶
func (p *SpriteImpl) SetCollisionLayer(layer int64)
func (*SpriteImpl) SetCollisionMask ¶
func (p *SpriteImpl) SetCollisionMask(mask int64)
func (*SpriteImpl) SetCostume__0 ¶
func (p *SpriteImpl) SetCostume__0(costume SpriteCostumeName)
func (*SpriteImpl) SetCostume__1 ¶
func (p *SpriteImpl) SetCostume__1(index float64)
func (*SpriteImpl) SetCostume__2 ¶
func (p *SpriteImpl) SetCostume__2(index int)
func (*SpriteImpl) SetCostume__3 ¶
func (p *SpriteImpl) SetCostume__3(action switchAction)
func (*SpriteImpl) SetGraphicEffect ¶
func (p *SpriteImpl) SetGraphicEffect(kind EffectKind, val float64)
func (*SpriteImpl) SetGravity ¶
func (p *SpriteImpl) SetGravity(gravity float64)
func (*SpriteImpl) SetHeading ¶
func (p *SpriteImpl) SetHeading(dir Direction)
func (*SpriteImpl) SetLayer__0 ¶
func (p *SpriteImpl) SetLayer__0(layer layerAction)
func (*SpriteImpl) SetLayer__1 ¶
func (p *SpriteImpl) SetLayer__1(dir dirAction, delta int)
func (*SpriteImpl) SetPenColor__0 ¶
func (p *SpriteImpl) SetPenColor__0(color Color)
func (*SpriteImpl) SetPenColor__1 ¶
func (p *SpriteImpl) SetPenColor__1(kind PenColorParam, value float64)
func (*SpriteImpl) SetPenSize ¶
func (p *SpriteImpl) SetPenSize(size float64)
func (*SpriteImpl) SetPhysicsMode ¶
func (p *SpriteImpl) SetPhysicsMode(mode PhysicsMode)
func (*SpriteImpl) SetRotationStyle ¶
func (p *SpriteImpl) SetRotationStyle(style RotationStyle)
func (*SpriteImpl) SetSize ¶
func (p *SpriteImpl) SetSize(size float64)
func (*SpriteImpl) SetSoundEffect ¶
func (p *SpriteImpl) SetSoundEffect(kind SoundEffectKind, value float64)
func (*SpriteImpl) SetTriggerEnabled ¶
func (p *SpriteImpl) SetTriggerEnabled(trigger bool)
func (*SpriteImpl) SetTriggerLayer ¶
func (p *SpriteImpl) SetTriggerLayer(layer int64)
func (*SpriteImpl) SetTriggerMask ¶
func (p *SpriteImpl) SetTriggerMask(mask int64)
func (*SpriteImpl) SetVelocity ¶
func (p *SpriteImpl) SetVelocity(velocityX, velocityY float64)
func (*SpriteImpl) SetVolume ¶
func (p *SpriteImpl) SetVolume(volume float64)
func (*SpriteImpl) SetXYpos ¶
func (p *SpriteImpl) SetXYpos(x, y float64)
func (*SpriteImpl) SetXpos ¶
func (p *SpriteImpl) SetXpos(x float64)
func (*SpriteImpl) SetYpos ¶
func (p *SpriteImpl) SetYpos(y float64)
func (*SpriteImpl) Show ¶
func (p *SpriteImpl) Show()
func (*SpriteImpl) ShowVar ¶
func (p *SpriteImpl) ShowVar(name string)
func (*SpriteImpl) Size ¶
func (p *SpriteImpl) Size() float64
func (*SpriteImpl) Stamp ¶
func (p *SpriteImpl) Stamp()
func (*SpriteImpl) StepTo__0 ¶
func (p *SpriteImpl) StepTo__0(sprite Sprite)
func (*SpriteImpl) StepTo__1 ¶
func (p *SpriteImpl) StepTo__1(sprite SpriteName)
func (*SpriteImpl) StepTo__2 ¶
func (p *SpriteImpl) StepTo__2(x, y float64)
func (*SpriteImpl) StepTo__3 ¶
func (p *SpriteImpl) StepTo__3(obj specialObj)
func (*SpriteImpl) StepTo__4 ¶
func (p *SpriteImpl) StepTo__4(sprite Sprite, speed float64)
func (*SpriteImpl) StepTo__5 ¶
func (p *SpriteImpl) StepTo__5(sprite SpriteName, speed float64)
func (*SpriteImpl) StepTo__6 ¶
func (p *SpriteImpl) StepTo__6(x, y, speed float64)
func (*SpriteImpl) StepTo__7 ¶
func (p *SpriteImpl) StepTo__7(obj specialObj, speed float64)
func (*SpriteImpl) StepTo__8 ¶
func (p *SpriteImpl) StepTo__8(sprite Sprite, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) StepTo__9 ¶
func (p *SpriteImpl) StepTo__9(sprite SpriteName, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) StepTo__a ¶
func (p *SpriteImpl) StepTo__a(x, y, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) StepTo__b ¶
func (p *SpriteImpl) StepTo__b(obj specialObj, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) Step__0 ¶
func (p *SpriteImpl) Step__0(step float64)
func (*SpriteImpl) Step__1 ¶
func (p *SpriteImpl) Step__1(step float64, speed float64)
func (*SpriteImpl) Step__2 ¶
func (p *SpriteImpl) Step__2(step float64, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) StopAnimation ¶
func (p *SpriteImpl) StopAnimation(name SpriteAnimationName)
func (*SpriteImpl) StopPlaying ¶
func (p *SpriteImpl) StopPlaying(name SoundName)
func (*SpriteImpl) Think__0 ¶
func (p *SpriteImpl) Think__0(msg any)
func (*SpriteImpl) Think__1 ¶
func (p *SpriteImpl) Think__1(msg any, secs float64)
func (*SpriteImpl) TimeSinceLevelLoad ¶
func (pself *SpriteImpl) TimeSinceLevelLoad() float64
func (*SpriteImpl) TouchingColor ¶
func (p *SpriteImpl) TouchingColor(color Color) bool
func (*SpriteImpl) Touching__0 ¶
func (p *SpriteImpl) Touching__0(sprite SpriteName) bool
func (*SpriteImpl) Touching__1 ¶
func (p *SpriteImpl) Touching__1(sprite Sprite) bool
func (*SpriteImpl) Touching__2 ¶
func (p *SpriteImpl) Touching__2(obj specialObj) bool
func (*SpriteImpl) TriggerEnabled ¶
func (p *SpriteImpl) TriggerEnabled() bool
func (*SpriteImpl) TriggerLayer ¶
func (p *SpriteImpl) TriggerLayer() int64
func (*SpriteImpl) TriggerMask ¶
func (p *SpriteImpl) TriggerMask() int64
func (*SpriteImpl) TurnTo__0 ¶
func (p *SpriteImpl) TurnTo__0(target Sprite)
func (*SpriteImpl) TurnTo__1 ¶
func (p *SpriteImpl) TurnTo__1(target SpriteName)
func (*SpriteImpl) TurnTo__2 ¶
func (p *SpriteImpl) TurnTo__2(dir Direction)
func (*SpriteImpl) TurnTo__3 ¶
func (p *SpriteImpl) TurnTo__3(target specialObj)
func (*SpriteImpl) TurnTo__4 ¶
func (p *SpriteImpl) TurnTo__4(target Sprite, speed float64)
func (*SpriteImpl) TurnTo__5 ¶
func (p *SpriteImpl) TurnTo__5(target SpriteName, speed float64)
func (*SpriteImpl) TurnTo__6 ¶
func (p *SpriteImpl) TurnTo__6(dir Direction, speed float64)
func (*SpriteImpl) TurnTo__7 ¶
func (p *SpriteImpl) TurnTo__7(target specialObj, speed float64)
func (*SpriteImpl) TurnTo__8 ¶
func (p *SpriteImpl) TurnTo__8(target Sprite, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) TurnTo__9 ¶
func (p *SpriteImpl) TurnTo__9(target SpriteName, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) TurnTo__a ¶
func (p *SpriteImpl) TurnTo__a(dir Direction, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) TurnTo__b ¶
func (p *SpriteImpl) TurnTo__b(target specialObj, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) Turn__0 ¶
func (p *SpriteImpl) Turn__0(dir Direction)
func (*SpriteImpl) Turn__1 ¶
func (p *SpriteImpl) Turn__1(dir Direction, speed float64)
func (*SpriteImpl) Turn__2 ¶
func (p *SpriteImpl) Turn__2(dir Direction, speed float64, animation SpriteAnimationName)
func (*SpriteImpl) Velocity ¶
func (p *SpriteImpl) Velocity() (velocityX, velocityY float64)
func (*SpriteImpl) Visible ¶
func (p *SpriteImpl) Visible() bool
func (*SpriteImpl) Volume ¶
func (p *SpriteImpl) Volume() float64
func (*SpriteImpl) Xpos ¶
func (p *SpriteImpl) Xpos() float64
func (*SpriteImpl) Ypos ¶
func (p *SpriteImpl) Ypos() float64
type StopKind ¶
type StopKind int
const ( AllStop StopKind = All // -3: stop all scripts of stage/sprites and abort this script 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 Value ¶
type Value struct {
// contains filtered or unexported fields
}
type Widget ¶
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_ ¶
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 `XGot_Game_XGox_GetWidget` only. We extract `GetWidget_` to keep `XGot_Game_XGox_GetWidget` simple, which simplifies work in ispx, see details in https://github.com/goplus/builder/issues/765#issuecomment-2313915805.
type WidgetName ¶
type WidgetName = string
Source Files
¶
- bubble_common.go
- bubble_quote.go
- bubble_text.go
- camera.go
- collision_optimizer.go
- component_animation.go
- component_bubble.go
- component_pen.go
- component_physics.go
- component_sound.go
- component_transform.go
- config.go
- debug.go
- event.go
- event_queue.go
- game.go
- game_backdrop.go
- game_builder.go
- game_input.go
- game_interaction.go
- game_loop.go
- game_pathfinding.go
- game_physics.go
- game_sound.go
- game_state.go
- game_tilemap.go
- game_util.go
- game_widget.go
- gdspx.go
- input.go
- list.go
- measure.go
- monitor.go
- runtime_managers.go
- sound_mgr.go
- spbase.go
- sprite.go
- sprite_animation.go
- sprite_bubble.go
- sprite_component.go
- sprite_impl.go
- sprite_manager.go
- sprite_pen.go
- sprite_physics.go
- sprite_render.go
- sprite_sound.go
- sprite_transform.go
- sprite_util.go
- tilemap.go
- widget.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ispx
command
|
|
|
ispxnative
command
|
|
|
spxrun
command
Package main implements the spxrun command for running SPX 2.0 projects.
|
Package main implements the spxrun command for running SPX 2.0 projects. |
|
spxrun/runner
Package runner implements the SPX 2.0 project runner.
|
Package runner implements the SPX 2.0 project runner. |
|
internal
|
|
|
debug
Package debug provides debugging utilities for stack traces and logging.
|
Package debug provides debugging utilities for stack traces and logging. |
|
log
Package log provides a unified logging system for SPX engine.
|
Package log provides a unified logging system for SPX engine. |
|
pkg
|
|
|
gdspx/internal/ffi
------------------------------------------------------------------------------ // This code was generated by template ffi_gdextension_interface.go.tmpl.
|
------------------------------------------------------------------------------ // This code was generated by template ffi_gdextension_interface.go.tmpl. |
|
gdspx/internal/webffi
------------------------------------------------------------------------------ // This code was generated by template ffi_wrapper.go.tmpl.
|
------------------------------------------------------------------------------ // This code was generated by template ffi_wrapper.go.tmpl. |
|
gdspx/internal/wrap
------------------------------------------------------------------------------ // This code was generated by template ffi_gdextension_interface.go.tmpl.
|
------------------------------------------------------------------------------ // This code was generated by template ffi_gdextension_interface.go.tmpl. |
|
gdspx/pkg/engine
------------------------------------------------------------------------------ // This code was generated by template ffi_gdextension_interface.go.tmpl.
|
------------------------------------------------------------------------------ // This code was generated by template ffi_gdextension_interface.go.tmpl. |



