Version: v0.0.0-...-29b1b17 Latest Latest

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

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 13 Imported by: 0




This section is empty.


This section is empty.


func FileExists

func FileExists(_file string) bool

func GetPath

func GetPath() string

GetPath returns the current working directory.

func HandleEvents

func HandleEvents(_event sdl.Event)

HandleEvents loops through and handles events polled from SDL.


type Engine

type Engine struct {
	KeyState []uint8
	// contains filtered or unexported fields

Engine holds the bindings for SDL and all callback functions to be called during the main game loop.

func NewEngine

func NewEngine(_title string) (engine *Engine)

NewEngine initializes a new engine instance.

func (*Engine) Exit

func (engine *Engine) Exit()

Exit frees all resources used by Engine for a clean exit.

func (*Engine) GraphicsClearFunction

func (engine *Engine) GraphicsClearFunction(env *object.Environment, args ...object.Object) object.Object

GraphicsClearFunction registers the Graphics.clear function with Ghost.

func (*Engine) GraphicsDrawFunction

func (engine *Engine) GraphicsDrawFunction(env *object.Environment, args ...object.Object) object.Object

GraphicsDrawFunction registers the Graphics.draw function with Ghost.

func (*Engine) GraphicsFilledRectangleFunction

func (engine *Engine) GraphicsFilledRectangleFunction(env *object.Environment, args ...object.Object) object.Object

GraphicsFilledRectangleFunction registers the Graphics.filledRectangle function with Ghost.

func (*Engine) GraphicsLineFunction

func (engine *Engine) GraphicsLineFunction(env *object.Environment, args ...object.Object) object.Object

GraphicsLineFunction registers the Graphics.line function with Ghost.

func (*Engine) GraphicsPixelFunction

func (engine *Engine) GraphicsPixelFunction(env *object.Environment, args ...object.Object) object.Object

GraphicsPixelFunction registers the Graphics.pixel function with Ghost.

func (*Engine) GraphicsPrintFunction

func (engine *Engine) GraphicsPrintFunction(env *object.Environment, args ...object.Object) object.Object

GraphicsPrintFunction registers the Graphics.print function with Ghost.

func (*Engine) GraphicsRectangleFunction

func (engine *Engine) GraphicsRectangleFunction(env *object.Environment, args ...object.Object) object.Object

GraphicsRectangleFunction registers the Graphics.rectangle function with Ghost.

func (*Engine) GraphicsSetColorFunction

func (engine *Engine) GraphicsSetColorFunction(env *object.Environment, args ...object.Object) object.Object

func (*Engine) KeyboardIsDownFunction

func (engine *Engine) KeyboardIsDownFunction(env *object.Environment, args ...object.Object) object.Object

KeyboardIsDownFunction registers the Keyboard.isDown function with Ghost.

func (*Engine) MouseHideCursorFunction

func (engine *Engine) MouseHideCursorFunction(env *object.Environment, args ...object.Object) object.Object

MouseHideCursorFunction registers the Mouse.hideCursor function with Ghost.

func (*Engine) MouseShowCursorFunction

func (engine *Engine) MouseShowCursorFunction(env *object.Environment, args ...object.Object) object.Object

MouseShowCursorFunction registers the Mouse.showCursor function with Ghost.

func (*Engine) Run

func (engine *Engine) Run(env *object.Environment)

Run the main game loop.

func (*Engine) SetDrawFunction

func (engine *Engine) SetDrawFunction(_draw func(env *object.Environment))

SetDrawFunction defines the draw function to be used by Engine.

func (*Engine) SetFPS

func (engine *Engine) SetFPS(_fps uint32)

SetFPS defines the desired frames per second threshold.

func (*Engine) SetLoadFunction

func (engine *Engine) SetLoadFunction(_load func(env *object.Environment))

SetLoadFunction defines the load function to be used by Engine.

func (*Engine) SetTitle

func (engine *Engine) SetTitle(_title string)

SetTitle defines the title of the window.

func (*Engine) SetUpdateFunction

func (engine *Engine) SetUpdateFunction(_update func(env *object.Environment))

SetUpdateFunction defines the update function to be used by Engine.

func (*Engine) SetWindow

func (engine *Engine) SetWindow(_width int32, _height int32)

SetWindow defines the windows width and height.

func (*Engine) WindowBorderedFunction

func (engine *Engine) WindowBorderedFunction(env *object.Environment, args ...object.Object) object.Object

WindowBorderedFunction registers the Window.bordered function with Ghost.

func (*Engine) WindowBorderlessFunction

func (engine *Engine) WindowBorderlessFunction(env *object.Environment, args ...object.Object) object.Object

WindowBorderlessFunction registers the Window.borderless function with Ghost.

func (*Engine) WindowFullscreenFunction

func (engine *Engine) WindowFullscreenFunction(env *object.Environment, args ...object.Object) object.Object

WindowFullscreenFunction registers the Window.fullscreen function with Ghost.

func (*Engine) WindowHeightFunction

func (engine *Engine) WindowHeightFunction(env *object.Environment, args ...object.Object) object.Object

WindowHeightFunction registers the Window.height function with Ghost.

func (*Engine) WindowSetSizeFunction

func (engine *Engine) WindowSetSizeFunction(env *object.Environment, args ...object.Object) object.Object

WindowSetSizeFunction registers the Window.setSize function with Ghost.

func (*Engine) WindowTitleFunction

func (engine *Engine) WindowTitleFunction(env *object.Environment, args ...object.Object) object.Object

WindowTitleFunction registers the Window.title function with Ghost.

func (*Engine) WindowWidthFunction

func (engine *Engine) WindowWidthFunction(env *object.Environment, args ...object.Object) object.Object

WindowWidthFunction registers the Window.width function with Ghost.

type Image

type Image struct {
	// contains filtered or unexported fields

Image defines a new image resource

func NewImage

func NewImage(_file string) *Image

NewImage loads a new image resource into memory.

func (*Image) Draw

func (image *Image) Draw(_x int, _y int)

type Resource

type Resource interface {
	// contains filtered or unexported methods

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto