Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClickOnBody ¶
type ClickOnBody interface { AddCirleBody(x, y, radius float64) AddRectangleBody(x1, x2, y1, y2 float64) IsMouseClickInBody(x, y float64) bool GetMousePosRelativeToOriginalSprite(x, y float64) (float64, float64) Clone() ClickOnBody // Should only be used by the sim. Pos(x, y float64) Angle(RadAngle float64) }
type CmdAddCostume ¶
type CmdAddNewSprite ¶
type CmdAddNewSprite struct {
SpriteID int
}
type CmdAddSound ¶
type CmdPlaySound ¶
type CmdSpriteDelete ¶
type CmdSpriteDelete struct {
SpriteID int
}
type CmdSpriteUpdateFull ¶
type CmdSpriteUpdateMin ¶
type CmdSpritesDeleteAll ¶
type CmdSpritesDeleteAll struct {
SpriteID int
}
type KeysStruct ¶
type KeysStruct struct { LeftArrow bool RightArrow bool UpArrow bool DownArrow bool A bool B bool C bool D bool E bool F bool G bool H bool I bool J bool K bool L bool M bool N bool O bool P bool Q bool R bool S bool T bool U bool V bool W bool X bool Y bool Z bool Number0 bool Number1 bool Number2 bool Number3 bool Number4 bool Number5 bool Number6 bool Number7 bool Number8 bool Number9 bool F1 bool F2 bool F3 bool F4 bool F5 bool F6 bool F7 bool F8 bool F9 bool F10 bool F11 bool F12 bool Space bool Backspace bool Tab bool LeftShift bool RightShift bool LeftCtrl bool RightCtrl bool LeftAlt bool RightAlt bool Enter bool Delete bool Escape bool Backquote bool Minus bool Equal bool Comma bool Period bool SemiColon bool Apostrophe bool ForwardSlash bool BackSlash bool OpenSquareBracket bool CloseSquareBracket bool }
type MouseStruct ¶
type NearMeInfo ¶
type Scratch ¶
type Scratch interface { GetWidth() int GetHeight() int AddCostume(img image.Image, name string) AddSprite(UniqueName string) Sprite // If no name is given, a random name is generated. DeleteSprite(Sprite) DeleteAllSprites() SpriteUpdatePosAngle(in Sprite) SpriteUpdateFull(in Sprite) AddSound(path, name string) PlaySound(name string, volume float64) // volume must be between 0 and 1. PressedUserInput() *UserInput SubscribeToJustPressedUserInput() chan *UserInput UnSubscribeToJustPressedUserInput(in chan *UserInput) GetSpriteID(UniqueName string) int GetSpriteInfo(UniqueName string) SpriteState GetSpriteInfoByID(id int) SpriteState WhoIsNearMe(x, y, distance float64) []NearMeInfo SendMsg(toSpriteID int, msg any) Exit() }
type Sprite ¶
type Sprite interface { GetSpriteID() int GetUniqueName() string Clone(UniqueName string) Sprite // Updates Costume(name string) SetType(newType int) Angle(angleDegrees float64) Pos(cartX, cartY float64) // Cartesian (x,y). Center in the middle of the window Z(int) // Visible(visible bool) Scale(scale float64) // Sets xScale and yScale together XYScale(xScale, yScale float64) Opacity(opacityPercent float64) // 0 is completely transparent and 100 is completely opaque All(in SpriteState) // Info GetState() SpriteState // Click Body GetClickBody() ClickOnBody ReplaceClickBody(in ClickOnBody) // User Input PressedUserInput() *UserInput JustPressedUserInput() *UserInput // Interact With other sprites WhoIsNearMe(distance float64) []NearMeInfo SendMsg(toSpriteID int, msg any) GetMsgs() []any AddMsg(msg any) // exit DeleteSprite() }
type SpriteState ¶
type UserInput ¶
type UserInput struct { AnyPressed bool Keys KeysStruct Mouse MouseStruct }
Click to show internal directories.
Click to hide internal directories.