Documentation ¶
Overview ¶
Package graphics handles the visualization of a game world in various techniques.
Index ¶
- type GraphicsComponent
- type Inputs
- type ModelTransfer
- type TextGraphicsHandler
- func (tgh *TextGraphicsHandler) DeleteModel(id component.GOiD)
- func (tgh *TextGraphicsHandler) DrawString(x, y float32, text string)
- func (tgh *TextGraphicsHandler) GetSize() (int, int)
- func (tgh *TextGraphicsHandler) HandleInputs() Inputs
- func (tgh *TextGraphicsHandler) LoadModel(id component.GOiD, gc GraphicsComponent) error
- func (tgh *TextGraphicsHandler) Render(ids *common.Vector, sm component.SceneManager)
- func (tgh *TextGraphicsHandler) RenderDiff(ids *common.Vector, sm component.SceneManager)
- func (tgh *TextGraphicsHandler) Tick() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphicsComponent ¶
type GraphicsComponent struct {
ModelName, Mesh, MeshType, Renderer, TextDescription string
}
GraphicsComponent represents data extracted from a graphics component file.
type ModelTransfer ¶
type ModelTransfer struct { Id component.GOiD Gc GraphicsComponent }
ModelTransfer is used to send creation information to the renderers over a channel.
type TextGraphicsHandler ¶
type TextGraphicsHandler struct {
// contains filtered or unexported fields
}
TextGraphicsHandler implements the GraphicsHandler interface, but instead of rendering to a graphics context, TextGraphicsHandler instead outputs textual descriptions of each model.
func MakeTextGraphicsHandler ¶
func MakeTextGraphicsHandler() *TextGraphicsHandler
MakeTextGraphicsHandler returns a pointer to a TextGraphicsHandler.
func (*TextGraphicsHandler) DeleteModel ¶
func (tgh *TextGraphicsHandler) DeleteModel(id component.GOiD)
DeleteModel implements the GraphicsHandler interface and deletes the data used for rendering.
func (*TextGraphicsHandler) DrawString ¶
func (tgh *TextGraphicsHandler) DrawString(x, y float32, text string)
DrawString implements the GraphicsHandler interface and outputs a the string passed in as an arguement. The x, y coordinates are ignored.
func (*TextGraphicsHandler) GetSize ¶
func (tgh *TextGraphicsHandler) GetSize() (int, int)
GetSize implements the GraphicsHandler interface, but returns 0, 0 always because the text window has no size.
func (*TextGraphicsHandler) HandleInputs ¶
func (tgh *TextGraphicsHandler) HandleInputs() Inputs
HandleInputs implements the GraphicsHandler interface and returns the inputs recieved since the last query.
func (*TextGraphicsHandler) LoadModel ¶
func (tgh *TextGraphicsHandler) LoadModel(id component.GOiD, gc GraphicsComponent) error
LoadModel implements the GraphicsHandler interface and adds data used to render the components later.
func (*TextGraphicsHandler) Render ¶
func (tgh *TextGraphicsHandler) Render(ids *common.Vector, sm component.SceneManager)
Render implements the Renderer interface and outputs text based on the GOiD's in the list passed as an argument.
func (*TextGraphicsHandler) RenderDiff ¶
func (tgh *TextGraphicsHandler) RenderDiff(ids *common.Vector, sm component.SceneManager)
RenderDiff outputs text based on the GOiD's in the list passed as an argument. The function will only output a new text description if the model has newly come into the scene.
func (*TextGraphicsHandler) Tick ¶
func (tgh *TextGraphicsHandler) Tick() bool
Tick returns the status of the text window.