Documentation ¶
Index ¶
- Variables
- func CreateTextBubble(width, height float64, inputText string, size float64) image.Image
- func CreateTextImg(inputText string, width, height, size float64, c color.Color) image.Image
- func DrawRoundedRectangleThoughBubble(dc *gg.Context, x, y, w, h, r float64)
- func Lerp(a, b, ratio float64) float64
- func LerpColor(a, b color.RGBA, ratio float64) color.RGBA
- func LerpUint8(a, b uint8, ratio float64) uint8
- type Broker
- type ClickOnBody
- func (s *ClickOnBody) AddCirleBody(x, y, radius float64)
- func (s *ClickOnBody) AddRectangleBody(x1, x2, y1, y2 float64)
- func (s *ClickOnBody) Angle(RadAngle float64)
- func (s *ClickOnBody) Clone() models.ClickOnBody
- func (s *ClickOnBody) GetMousePosRelativeToOriginalSprite(x, y float64) (float64, float64)
- func (s *ClickOnBody) IsMouseClickInBody(x, y float64) bool
- func (s *ClickOnBody) Pos(x, y float64)
- type PositionBroker
- func (s *PositionBroker) AddSprite(id int)
- func (s *PositionBroker) GetSpriteInfo(id int) models.SpriteState
- func (s *PositionBroker) GetSpritesNearMe(x, y, distance float64) []models.NearMeInfo
- func (s *PositionBroker) RemoveSprite(id int)
- func (s *PositionBroker) UpdateSpriteInfo(id int, state models.SpriteState)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Black color.RGBA = color.RGBA{0x00, 0x00, 0x00, 0xFF} White color.RGBA = color.RGBA{0xFF, 0xFF, 0xFF, 0xFF} Red color.RGBA = color.RGBA{0xFF, 0x00, 0x00, 0xFF} Lime color.RGBA = color.RGBA{0x00, 0xFF, 0x00, 0xFF} Blue color.RGBA = color.RGBA{0x00, 0x00, 0xFF, 0xFF} Yellow color.RGBA = color.RGBA{0xFF, 0xFF, 0x00, 0xFF} Aqua color.RGBA = color.RGBA{0x00, 0xFF, 0xFF, 0xFF} Magenta color.RGBA = color.RGBA{0xFF, 0x00, 0xFF, 0xFF} Orange color.RGBA = color.RGBA{0xFF, 0xA5, 0x00, 0xFF} Green color.RGBA = color.RGBA{0x00, 0x80, 0x00, 0xFF} Purple color.RGBA = color.RGBA{0x80, 0x00, 0x80, 0xFF} Indigo color.RGBA = color.RGBA{0x4B, 0x00, 0x82, 0xFF} Violet color.RGBA = color.RGBA{0xEE, 0x82, 0xEE, 0xFF} // Other random ones SkyBlue color.RGBA = color.RGBA{0x87, 0xCE, 0xEB, 0xFF} )
Functions ¶
func CreateTextBubble ¶
func CreateTextImg ¶
func DrawRoundedRectangleThoughBubble ¶
Expanded version of gg.Context.DrawRoundedRectangle(...)
Types ¶
type Broker ¶
type Broker[T any] struct { // contains filtered or unexported fields }
A data broker that can be published to, and eny entity that has subscribed will get a copy of the message. https://stackoverflow.com/questions/36417199/how-to-broadcast-message-using-channel https://stackoverflow.com/a/49877632
func (*Broker[T]) Unsubscribe ¶
func (b *Broker[T]) Unsubscribe(msgCh chan T)
type ClickOnBody ¶
type ClickOnBody struct {
// contains filtered or unexported fields
}
func NewTouchCollisionBody ¶
func NewTouchCollisionBody() *ClickOnBody
func (*ClickOnBody) AddCirleBody ¶
func (s *ClickOnBody) AddCirleBody(x, y, radius float64)
func (*ClickOnBody) AddRectangleBody ¶
func (s *ClickOnBody) AddRectangleBody(x1, x2, y1, y2 float64)
func (*ClickOnBody) Angle ¶
func (s *ClickOnBody) Angle(RadAngle float64)
func (*ClickOnBody) Clone ¶
func (s *ClickOnBody) Clone() models.ClickOnBody
func (*ClickOnBody) GetMousePosRelativeToOriginalSprite ¶
func (s *ClickOnBody) GetMousePosRelativeToOriginalSprite(x, y float64) (float64, float64)
func (*ClickOnBody) IsMouseClickInBody ¶
func (s *ClickOnBody) IsMouseClickInBody(x, y float64) bool
func (*ClickOnBody) Pos ¶
func (s *ClickOnBody) Pos(x, y float64)
type PositionBroker ¶
type PositionBroker struct {
// contains filtered or unexported fields
}
func NewPositionBroker ¶
func NewPositionBroker() *PositionBroker
func (*PositionBroker) AddSprite ¶
func (s *PositionBroker) AddSprite(id int)
func (*PositionBroker) GetSpriteInfo ¶
func (s *PositionBroker) GetSpriteInfo(id int) models.SpriteState
func (*PositionBroker) GetSpritesNearMe ¶
func (s *PositionBroker) GetSpritesNearMe(x, y, distance float64) []models.NearMeInfo
func (*PositionBroker) RemoveSprite ¶
func (s *PositionBroker) RemoveSprite(id int)
func (*PositionBroker) UpdateSpriteInfo ¶
func (s *PositionBroker) UpdateSpriteInfo(id int, state models.SpriteState)
Click to show internal directories.
Click to hide internal directories.