1
0
Fork 0
tetris-go/engine/graphics/tile.go
2025-09-14 22:16:29 +02:00

18 lines
347 B
Go

package graphics
import rl "github.com/gen2brain/raylib-go/raylib"
type Tile struct {
Size byte
X, Y byte
}
// GetTexRect returns the texture rectangle.
func (t Tile) GetTexRect() rl.Rectangle {
return rl.Rectangle{
X: float32(t.X * t.Size),
Y: float32(t.Y * t.Size),
Width: float32(t.Size),
Height: float32(t.Size),
}
}