func (button *Button) Draw(rend *sdl.Renderer) { w := button.Pos.W state := button.State if state > 2 { state = 2 } rend.Copy(button.texture, &sdl.Rect{int32(state) * w, 0, button.Pos.W, button.Pos.H}, &button.Pos) }
func (label *Label) Draw(rend *sdl.Renderer) { pos := sdl.Rect{label.Pos.X + (label.Pos.W-label.texwidth)/2, label.Pos.Y + (label.Pos.H-label.texheight)/2, label.texwidth, label.texheight} rend.Copy(label.texture, nil, &pos) }