Skip to content

Commit

Permalink
Added SetFlipH() and SetFlipV() to the Sprite struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
yohamta committed Apr 3, 2022
1 parent 583f438 commit 23e12b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sprite.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ func (spr *Sprite) FlipV() {
spr.flippedV = !spr.flippedV
}

// SetFlipH flips the sprite horizontally.
func (spr *Sprite) SetFlipH(flipH bool) {
spr.flippedH = flipH
}

// SetFlipV flips the sprite vertically.
func (spr *Sprite) SetFlipV(flipV bool) {
spr.flippedV = flipV
}

// Draw draws the current frame with the specified options.
func (spr *Sprite) Draw(screen *ebiten.Image, index int, opts *DrawOptions) {
x, y := opts.X, opts.Y
Expand Down

0 comments on commit 23e12b3

Please sign in to comment.