gui

package
v0.0.0-...-48f6ed3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOP_LEFT     = 0
	TOP_RIGHT    = 1
	BOTTOM_LEFT  = 2
	BOTTOM_RIGHT = 3
)

Variables

This section is empty.

Functions

func InitTopContainer

func InitTopContainer()

Types

type BasicComponentImpl

type BasicComponentImpl struct {
	X, Y, W, H int
}

type Component

type Component interface {

	// Returns true if the Scene cares about input
	AcceptsInput() bool

	// Processes input events
	HandleInput(keyEvents []windows.KeyboardInputEvent, mouseEvents []windows.MouseInputEvent) windows.WindowAction

	// Update the game frame and process time-dependant input
	Tick(timedelta float64, keyStates []bool)

	// Render the component
	Render()
}

type Image

type Image struct {
	StaticComponentImpl
	// contains filtered or unexported fields
}

func (*Image) Render

func (img *Image) Render()

type StaticComponentImpl

type StaticComponentImpl struct {
}

A partial component implementation that ignores input and ticks

func (*StaticComponentImpl) AcceptsInput

func (self *StaticComponentImpl) AcceptsInput() bool

func (*StaticComponentImpl) HandleInput

func (self *StaticComponentImpl) HandleInput(keyEvents []windows.KeyboardInputEvent, mouseEvents []windows.MouseInputEvent) windows.WindowAction

func (*StaticComponentImpl) Tick

func (self *StaticComponentImpl) Tick(timedelta float64, keyStates []bool)

type StaticTexturedComponent

type StaticTexturedComponent struct {
	TexturedComponentImpl
	StaticComponentImpl
}

StaticTexturedComponent is a basic component that takes no input and renders a texture

type TexturedComponentImpl

type TexturedComponentImpl struct {
	BasicComponentImpl
	// contains filtered or unexported fields
}

func (*TexturedComponentImpl) Move

func (c *TexturedComponentImpl) Move(x, y, w, h int)

func (*TexturedComponentImpl) Render

func (c *TexturedComponentImpl) Render()

func (*TexturedComponentImpl) SetTexture

func (c *TexturedComponentImpl) SetTexture(texture uint32, topleft, topright, bottomleft, bottomright mgl32.Vec2)

assign a texture and texture coordinates to this component

type TopContainerType

type TopContainerType struct {
	windows.SimpleSceneImpl
	// contains filtered or unexported fields
}
var TopContainer *TopContainerType

func (*TopContainerType) HandleInput

func (self *TopContainerType) HandleInput(key_events []windows.KeyboardInputEvent,
	mouse_events []windows.MouseInputEvent) windows.WindowAction

func (*TopContainerType) Init

func (self *TopContainerType) Init()

func (*TopContainerType) Program

func (self *TopContainerType) Program() uint32

func (*TopContainerType) Render

func (self *TopContainerType) Render()

func (*TopContainerType) Tick

func (self *TopContainerType) Tick(timedelta float64, key_states []bool)

Jump to

Keyboard shortcuts

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