Documentation ¶
Index ¶
- func CalcRenderedPos(fx, fy, width, height int, mode PositionMode) (nx, ny int)
- func CalcRenderedPosFromRectangle(fx, fy int, r image.Rectangle, mode PositionMode) (nx, ny int)
- func Rectangle(x, y, w, h int) image.Rectangle
- func RectangleFrom(x, y int, r image.Rectangle) image.Rectangle
- type PositionMode
- type Rect
- func (r *Rect) Center(x, y int) *Rect
- func (r *Rect) Clicked() bool
- func (r *Rect) ClickedBy(key ebiten.MouseButton) bool
- func (r *Rect) Clone() *Rect
- func (r *Rect) From(x, y int, mode PositionMode) *Rect
- func (r *Rect) Hover() bool
- func (r *Rect) Max() image.Point
- func (r *Rect) Min() image.Point
- func (r *Rect) Pressed() bool
- func (r *Rect) PressedBy(key ebiten.MouseButton) bool
- func (r *Rect) Size() image.Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcRenderedPos ¶
func CalcRenderedPos(fx, fy, width, height int, mode PositionMode) (nx, ny int)
CalcRenderedPos calculates the bottom-left position to render at from the transformed position in that specified mode
func CalcRenderedPosFromRectangle ¶
func CalcRenderedPosFromRectangle(fx, fy int, r image.Rectangle, mode PositionMode) (nx, ny int)
CalcRenderedPosFromRectangle calculates the bottom-left position to render at from the transformed position in that specified mode
Types ¶
type PositionMode ¶
type PositionMode int
const ( TopLeft PositionMode = iota TopCenter TopRight CenterLeft Center CenterRight BottomLeft BottomCenter BottomRight )
type Rect ¶
type Rect struct {
// contains filtered or unexported fields
}
Rect is a image.Rectangle with the capability to translate
func (*Rect) From ¶
func (r *Rect) From(x, y int, mode PositionMode) *Rect
From move the rect to the position in the mode
Click to show internal directories.
Click to hide internal directories.