Documentation ¶
Index ¶
- Variables
- func CalcCurrentFrame(difftick int64, fps float64) int
- func InitApp()
- type Sprite
- func LoadBallSprite(teamname string) [gameobjtype.GameObjType_Count]*Sprite
- func LoadSpriteRotate(srcImageID string, start, end, step float64) *Sprite
- func LoadSpriteRotateResize(srcImageID string, start, end, step float64, xSliceW, ySliceH float64) *Sprite
- func LoadSpriteXYN(srcImageID string, xn, yn int) *Sprite
- func LoadSpriteXYNResize(srcImageID string, xn, yn int, xSliceW, ySliceH float64) *Sprite
- type Sprites
- type Viewport
- type WasmClient
- func (app *WasmClient) CanUseCmd(cmd w2d_idcmd.CommandID) bool
- func (app *WasmClient) Cleanup()
- func (app *WasmClient) DisplayTextInfo()
- func (app *WasmClient) GetEstServerTick() int64
- func (app *WasmClient) NetInit(ctx context.Context) (*w2d_obj.RspLogin_data, error)
- func (app *WasmClient) ReqWithRspFn(cmd w2d_idcmd.CommandID, body interface{}, fn w2d_pid2rspfn.HandleRspFn) error
- func (app *WasmClient) ReqWithRspFnWithAuth(cmd w2d_idcmd.CommandID, body interface{}, fn w2d_pid2rspfn.HandleRspFn) error
- func (app *WasmClient) ResizeCanvas()
Constants ¶
This section is empty.
Variables ¶
View Source
var DemuxNoti2ObjFnMap = [...]func(me interface{}, hd w2d_packet.Header, body interface{}) error{ w2d_idnoti.Invalid: objRecvNotiFn_Invalid, w2d_idnoti.StageInfo: objRecvNotiFn_StageInfo, w2d_idnoti.StatsInfo: objRecvNotiFn_StatsInfo, w2d_idnoti.StageChat: objRecvNotiFn_StageChat, }
Functions ¶
func CalcCurrentFrame ¶
Types ¶
type Sprite ¶
type Sprite struct { ImgCanvas js.Value ImgCtx js.Value // one sprite slice size W float64 H float64 // image count x, y XCount int YCount int }
func LoadBallSprite ¶
func LoadBallSprite(teamname string) [gameobjtype.GameObjType_Count]*Sprite
func LoadSpriteRotate ¶
LoadSpriteRotate load a image and make multi rotated image sptite
func LoadSpriteRotateResize ¶
func LoadSpriteXYN ¶
LoadSpriteXYN load multi image sprite
func LoadSpriteXYNResize ¶
func (*Sprite) CalcAlignDstCenter ¶
func (*Sprite) CalcAlignDstTopLeft ¶
func (*Sprite) GetSliceCount ¶
type Sprites ¶
type Sprites struct { BallSprites [teamtype.TeamType_Count][gameobjtype.GameObjType_Count]*Sprite EffectSprite [effecttype.EffectType_Count]*Sprite CloudSprite *Sprite BGSprite *Sprite }
func LoadSprites ¶
func LoadSprites() *Sprites
type Viewport ¶
type Viewport struct { Canvas js.Value W float64 H float64 // contains filtered or unexported fields }
func NewViewport ¶
func NewViewport() *Viewport
func (*Viewport) AddEventListener ¶
type WasmClient ¶
type WasmClient struct { DoClose func() ServerJitter *actjitter.ActJitter ClientJitter *actjitter.ActJitter PingDur int64 ServerClientTictDiff int64 DispInterDur *intervalduration.IntervalDuration KeyboardPressedMap *jskeypressmap.KeyPressMap // contains filtered or unexported fields }
func (*WasmClient) Cleanup ¶
func (app *WasmClient) Cleanup()
func (*WasmClient) DisplayTextInfo ¶
func (app *WasmClient) DisplayTextInfo()
func (*WasmClient) GetEstServerTick ¶
func (app *WasmClient) GetEstServerTick() int64
func (*WasmClient) NetInit ¶
func (app *WasmClient) NetInit(ctx context.Context) (*w2d_obj.RspLogin_data, error)
func (*WasmClient) ReqWithRspFn ¶
func (app *WasmClient) ReqWithRspFn(cmd w2d_idcmd.CommandID, body interface{}, fn w2d_pid2rspfn.HandleRspFn) error
func (*WasmClient) ReqWithRspFnWithAuth ¶
func (app *WasmClient) ReqWithRspFnWithAuth(cmd w2d_idcmd.CommandID, body interface{}, fn w2d_pid2rspfn.HandleRspFn) error
func (*WasmClient) ResizeCanvas ¶
func (app *WasmClient) ResizeCanvas()
Click to show internal directories.
Click to hide internal directories.