rect

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

README

rect

Rectangle struct with useful attributes

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rectangle

type Rectangle struct {
	X, Y, Width, Height int
	Color               color.Color
}

func Rect

func Rect(x, y, width, height int) *Rectangle

Rect creates a new Rectangle with the given X, Y, Width, and Height.

func (*Rectangle) Bottom

func (r *Rectangle) Bottom(val ...int) int

func (*Rectangle) BottomLeft

func (r *Rectangle) BottomLeft(val ...int) (int, int)

func (*Rectangle) BottomRight

func (r *Rectangle) BottomRight(val ...int) (int, int)

func (*Rectangle) Center

func (r *Rectangle) Center(val ...int) (int, int)

func (*Rectangle) CenterX

func (r *Rectangle) CenterX(val ...int) int

func (*Rectangle) CenterY

func (r *Rectangle) CenterY(val ...int) int

func (*Rectangle) CollidesWith

func (r *Rectangle) CollidesWith(s *Rectangle) bool

CollidesWith checks if two rectangles overlap

func (*Rectangle) Draw

func (r *Rectangle) Draw(screen *ebiten.Image)

Draw a rectangle on the screen using the ebiten vector package with white default color

func (*Rectangle) DrawCircle

func (r *Rectangle) DrawCircle(screen *ebiten.Image)

DrawCircle draws an ellipse on the screen using the ebiten vector package with white default color this is a rectangle, but for some reason we want to draw circle

func (*Rectangle) Empty

func (r *Rectangle) Empty() bool

Empty reports whether the rectangle contains no points.

func (*Rectangle) Left

func (r *Rectangle) Left(val ...int) int

func (*Rectangle) MidBottom

func (r *Rectangle) MidBottom(val ...int) (int, int)

func (*Rectangle) MidLeft

func (r *Rectangle) MidLeft(val ...int) (int, int)

func (*Rectangle) MidRight

func (r *Rectangle) MidRight(val ...int) (int, int)

func (*Rectangle) MidTop

func (r *Rectangle) MidTop(val ...int) (int, int)

func (*Rectangle) Right

func (r *Rectangle) Right(val ...int) int

func (*Rectangle) Size

func (r *Rectangle) Size(val ...int) (int, int)

func (*Rectangle) Top

func (r *Rectangle) Top(val ...int) int

func (*Rectangle) TopLeft

func (r *Rectangle) TopLeft(val ...int) (int, int)

func (*Rectangle) TopRight

func (r *Rectangle) TopRight(val ...int) (int, int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL