30 lines
811 B
Go
30 lines
811 B
Go
package pinwindows
|
|
|
|
import rl "github.com/gen2brain/raylib-go/raylib"
|
|
|
|
func DrawTextureFlipped(rentex *rl.Texture2D, posx, posy int32) {
|
|
rl.DrawTexturePro(*rentex, rl.NewRectangle(0, 0, float32(rentex.Width), -float32(rentex.Height)), rl.NewRectangle(float32(posx), float32(posy), float32(rentex.Width), float32(rentex.Height)), rl.NewVector2(0, 0), 0, rl.White)
|
|
}
|
|
|
|
func UpdateRenderTexture(texture *rl.RenderTexture2D) {
|
|
if rl.IsWindowResized() {
|
|
rl.UnloadRenderTexture(*texture)
|
|
*texture = rl.LoadRenderTexture(int32(rl.GetScreenWidth()), int32(rl.GetScreenHeight()))
|
|
}
|
|
}
|
|
|
|
type Parent interface {
|
|
GetPosition() rl.Vector2
|
|
GetAbsPosition() rl.Vector2
|
|
GetSize() rl.Vector2
|
|
AddChild(Child)
|
|
}
|
|
|
|
type Child interface {
|
|
Draw()
|
|
DrawInternal()
|
|
SetPos(int, int)
|
|
SetSize(int, int)
|
|
GetSize() rl.Vector2
|
|
}
|