goldengine

package module
v0.0.0-...-8508653 Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//DefaultPrefabsFolderName : prefabs
	DefaultPrefabsFolderName = "prefabs"
	//DefaultResourcesFolderName : resources
	DefaultResourcesFolderName = "resources"
	//DefaultScenesFolderName : scenes
	DefaultScenesFolderName = "scenes"
)
View Source
const (
	//SpriteName : Name of Transformer
	SpriteName = "Sprite"
	//CircleShapeName : Name of Transformer
	CircleShapeName = "CircleShape"
	//ConvexShapeName : Name of Transformer
	ConvexShapeName = "ConvexShape"
	//RectangleShapeName : Name of Transformer
	RectangleShapeName = "RectangleShape"
	//TextName : Name of Transformer
	TextName = "Text"
)
View Source
const (
	//DefaultGameWidth : Width in Pixels of Game Window
	DefaultGameWidth = 800
	//DefaultGameHeight : Height in Pixels of Game Window
	DefaultGameHeight = 600
	//DefaultTitle : Title of Game Window
	DefaultTitle = "Gold Engine"
)
View Source
const (
	//CircleColliderName : Name of Circle Collider
	CircleColliderName = "CircleShape"
)
View Source
const KeyPressedMSG = MessageType("KeyPressed")

KeyPressedMSG : KeyWasReleased

View Source
const KeyReleasedMSG = MessageType("KeyReleased")

KeyReleasedMSG : KeyWasPressed

View Source
const RootNodeName = "ROOT"

RootNodeName : Default Name for The rootnode of all scenes

View Source
const SceneAddedEntityMSG = MessageType("SceneAddedEntity")

SceneAddedEntityMSG : Added Entity to scene. Sends pointer to entity

View Source
const SceneChangedMSG = MessageType("SceneChanged")

SceneChangedMSG : Game has changed scene

View Source
const SceneLoadedMSG = MessageType("SceneLoaded")

SceneLoadedMSG : Scene Was loaded returns pointer to scene

Variables

View Source
var ColliderGenerators = map[string]func(args map[string]interface{}) (*chipmunk.Body, error){
	CircleColliderName: CircleColliderFromColliderPrefab,
}

ColliderGenerators : map to generators for bodies

View Source
var ComponentRegister = componentRegister{
	// contains filtered or unexported fields
}

ComponentRegister : map of generators for a componentName

View Source
var ErrComponentAlreadyRegistered = errors.New("A Component With That Name Was Already Registered")

ErrComponentAlreadyRegistered : Cannot register a ComponentGenerator because the name is already registered

View Source
var PrefabRegister = prefabRegister{
	// contains filtered or unexported fields
}

PrefabRegister : Has all the EntityPrefab

TranformerGenerators : map to create Generators

View Source
var ZeroVector = Vector{X: 0, Y: 0}

ZeroVector : Vector initialized to zero

Functions

func ApplyArgsToShape

func ApplyArgsToShape(shape Shape, args map[string]interface{})

ApplyArgsToShape : Sets Properties like OutlineThickness

func ApplyChipmunkBodyProperties

func ApplyChipmunkBodyProperties(shape *chipmunk.Shape, body *chipmunk.Body, args map[string]interface{})

ApplyChipmunkBodyProperties : Sets common chipmunk body properties

func ApplyChipmunkShapeProperties

func ApplyChipmunkShapeProperties(shape *chipmunk.Shape, args map[string]interface{})

ApplyChipmunkShapeProperties : Sets common chipmunk shape properties

func ArgAsChipmunkFloat

func ArgAsChipmunkFloat(arg interface{}) (vect.Float, bool)

ArgAsChipmunkFloat : Converts an interface from a JSON Parser to a chipmunk Float

func ArgAsChipmunkVector

func ArgAsChipmunkVector(arg interface{}) (vect.Vect, bool)

ArgAsChipmunkVector : Converts an interface from a JSON Parser to a chipmunk

func ArgAsColor

func ArgAsColor(arg interface{}) (sf.Color, bool)

ArgAsColor Converts an interface from a JSON Parser to a Color

func ArgAsFloat32

func ArgAsFloat32(arg interface{}) (float32, bool)

ArgAsFloat32 Converts an interface from a JSON Parser to a float32

func ArgAsVector2f

func ArgAsVector2f(arg interface{}) (sf.Vector2f, bool)

ArgAsVector2f Converts an interface from a JSON Parser to a Vector2f

func CircleColliderFromColliderPrefab

func CircleColliderFromColliderPrefab(args map[string]interface{}) (*chipmunk.Body, error)

CircleColliderFromColliderPrefab : Creates a body shape

func ColliderFromColliderPrefab

func ColliderFromColliderPrefab(c ColliderPrefab) (*chipmunk.Body, error)

ColliderFromColliderPrefab : Returns a Collider from ColliderPrefab

func NewScreenWidth

func NewScreenWidth(width uint)

NewScreenWidth : Change The screenWidth

Types

type Address

type Address uint32

Address : uint32 unique to every box

type BaseComponent

type BaseComponent struct {
	// contains filtered or unexported fields
}

BaseComponent : Struct implementing all Component Properties. Allows the user to overload whatever methods they'd like

func (*BaseComponent) Awake

func (b *BaseComponent) Awake()

Awake : Called After Start and after sleep

func (*BaseComponent) GetEntity

func (b *BaseComponent) GetEntity() *Entity

GetEntity : What Entity this component acts on

func (*BaseComponent) SetEntity

func (b *BaseComponent) SetEntity(e *Entity)

SetEntity : What Entity this component should acts on

func (*BaseComponent) Sleep

func (b *BaseComponent) Sleep()

Sleep : Pause Component

func (*BaseComponent) Start

func (b *BaseComponent) Start()

Start : Called before gameloop

func (*BaseComponent) Stop

func (b *BaseComponent) Stop()

Stop : Called When an entity is going to be destroyed Once called Awake and Update are never called again

func (*BaseComponent) Update

func (b *BaseComponent) Update(duration time.Duration)

Update : Do something given the time that's passed since last

type BasicMailBox

type BasicMailBox struct {
	// contains filtered or unexported fields
}

BasicMailBox : Struct that accepts and recieves messages

func (*BasicMailBox) GetAddress

func (box *BasicMailBox) GetAddress() Address

GetAddress : Gets the Address of Mailbox

func (*BasicMailBox) GetOffice

func (box *BasicMailBox) GetOffice() *PostOffice

GetOffice : Returns the mailbox office

func (*BasicMailBox) PostMessage

func (box *BasicMailBox) PostMessage(msg Message)

PostMessage : Send Out a Message

func (*BasicMailBox) RecieveMessage

func (box *BasicMailBox) RecieveMessage(msg Message)

RecieveMessage : Recieve a Message. Should Override

func (*BasicMailBox) Remove

func (box *BasicMailBox) Remove()

Remove : mailbox removes itself from its office

func (*BasicMailBox) SetAddress

func (box *BasicMailBox) SetAddress(a Address)

SetAddress : Sets the Address of Mailbox

func (*BasicMailBox) SetOffice

func (box *BasicMailBox) SetOffice(office *PostOffice)

SetOffice : Sets this Boxes Office

type CircleShape

type CircleShape sf.CircleShape

CircleShape : Wrapper around sfml Object

type ColliderPrefab

type ColliderPrefab struct {
	Kind      string
	Arguments map[string]interface{}
}

ColliderPrefab : Generates a Collider (chipmunk body) from configuration

type Component

type Component interface {
	Awake()
	Start()
	Stop()
	Update(time.Duration)
	Sleep()
	SetEntity(e *Entity)
	GetEntity() *Entity
}

Component : Grants an entity an ability

func ComponentFromComponentPrefab

func ComponentFromComponentPrefab(c ComponentPrefab) Component

ComponentFromComponentPrefab : Returns a Component from a ComponentPrefab

type ComponentGenerator

type ComponentGenerator func(args map[string]interface{}) Component

ComponentGenerator : Function that takes the minimum arguments required to create a component

type ComponentPrefab

type ComponentPrefab struct {
	Name      string
	Arguments map[string]interface{}
}

ComponentPrefab : Generates a Component with the Given name from the Arguments

type ConvexShape

type ConvexShape sf.ConvexShape

ConvexShape : Wrapper around sfml Object

type Entity

type Entity struct {
	Name string

	KeyboardSet *KeyboardSet

	Transfrom Transformer
	Collider  *chipmunk.Body
	// contains filtered or unexported fields
}

Entity : Entity

func EntityFromEntityPrefab

func EntityFromEntityPrefab(prefab EntityPrefab) *Entity

EntityFromEntityPrefab : Returns Entity from Entity Prefab

func EntityFromSceneDefEntity

func EntityFromSceneDefEntity(def SceneDefEntity) (*Entity, error)

EntityFromSceneDefEntity : Creates an Entity from a scene definition entity

func NewEntity

func NewEntity() *Entity

NewEntity : Create a new Entity

func (*Entity) AddChild

func (e *Entity) AddChild(child *Entity)

AddChild : Adds A child to the entity

func (*Entity) AddComponent

func (e *Entity) AddComponent(comp Component)

AddComponent : Associates a component with a given entity

func (*Entity) Awake

func (e *Entity) Awake()

Awake : Called After Start and after sleep

func (*Entity) RecalculateScale

func (e *Entity) RecalculateScale()

RecalculateScale : Changes the size of sfml and chipmunk objects

func (*Entity) RemoveChild

func (e *Entity) RemoveChild(child *Entity)

RemoveChild : Removes Child Enttiy

func (*Entity) Sleep

func (e *Entity) Sleep()

Sleep : Shouldn't Update Entity Anymore

func (*Entity) Start

func (e *Entity) Start()

Start : Called before gameloop

func (*Entity) Stop

func (e *Entity) Stop()

Stop : Shouldn't Update Entity Anymore

func (*Entity) Update

func (e *Entity) Update(dur time.Duration)

Update : Called during the gameloop

type EntityPrefab

type EntityPrefab struct {
	Name        string
	Components  []ComponentPrefab
	Transformer TransformerPrefab
	Collider    ColliderPrefab
}

EntityPrefab : Information Required to Create an Entity from JSON Prefab

type Game

type Game struct {
	PostOffice          *PostOffice
	PrefabsFolderName   string
	ResourcesFolderName string
	ScenesFolderName    string

	//Composed Structs
	BasicMailBox //TODO : Use this for RPC
	// contains filtered or unexported fields
}

Game : Controls Actual Game

var GlobalGame *Game

GlobalGame : Currently running game

func NewGame

func NewGame(config GameConfig, wc WindowConfig, pc PhysicsEngineConfig) *Game

NewGame : Returns an app.

func (*Game) ChangeScene

func (g *Game) ChangeScene(name string)

ChangeScene : Loads a new scne

func (*Game) GetCurrentScene

func (g *Game) GetCurrentScene() *Scene

GetCurrentScene : Get the current rendered scene

func (*Game) GetScene

func (g *Game) GetScene(name string) (*Scene, bool)

GetScene : Returns a scene

func (*Game) GetSize

func (g *Game) GetSize() Vector

GetSize : Get the size of the game window

func (*Game) GetWindow

func (g *Game) GetWindow() *Window

GetWindow : Returns the window of a game

func (*Game) Init

func (g *Game) Init()

Init : Loads prefabs resources and scenes

func (*Game) LoadSceneFromFile

func (g *Game) LoadSceneFromFile(path string) (*Scene, error)

LoadSceneFromFile : Gets Scene from File

func (*Game) ProcessArguments

func (g *Game) ProcessArguments()

ProcessArguments : Handles CommandLine Arguments

func (*Game) Run

func (g *Game) Run()

Run : Runs Game

type GameConfig

type GameConfig struct {
	Name                string
	LogFile             io.Writer
	PrefabsFolderName   string
	ResourcesFolderName string
	ScenesFolderName    string
	Debug               bool
}

GameConfig : Adjust Paramaters for an App

Defaults

Name: App:NoName LogFile: os.Stdout

type InputCollection

type InputCollection struct {
	BasicMailBox
	// contains filtered or unexported fields
}

InputCollection : Collection of Sets handling Mouse and Keyboard Input. Used to emulate keyboard input.

func GenInputCollection

func GenInputCollection() *InputCollection

GenInputCollection : Convienece function for making an InputCollection

func (*InputCollection) ActivateSet

func (collection *InputCollection) ActivateSet(set *KeyboardSet)

ActivateSet : KeyboardSet will recive input

func (*InputCollection) DeactivateSet

func (collection *InputCollection) DeactivateSet(set *KeyboardSet)

DeactivateSet : KeyboardSet will nolong recieve input

func (*InputCollection) DeactivateSets

func (collection *InputCollection) DeactivateSets()

DeactivateSets : All sets will no longer recive input

func (*InputCollection) InstallKeyboardSet

func (collection *InputCollection) InstallKeyboardSet(set *KeyboardSet)

InstallKeyboardSet : Add set to collection

func (*InputCollection) KeyPressed

func (collection *InputCollection) KeyPressed(code sf.KeyCode)

KeyPressed : Puts KeyPressed

func (*InputCollection) KeyReleased

func (collection *InputCollection) KeyReleased(code sf.KeyCode)

KeyReleased : Puts KeyReleased

func (*InputCollection) RecieveMessage

func (collection *InputCollection) RecieveMessage(msg Message)

RecieveMessage : Fuffils the MailBox Requirement

func (*InputCollection) UninstallKeyboardSet

func (collection *InputCollection) UninstallKeyboardSet(set *KeyboardSet)

UninstallKeyboardSet : Remove set from collection

type KeyCommand

type KeyCommand func()

KeyCommand : Function called when a button is pressed or released

type KeyboardHandler

type KeyboardHandler struct {
	KeyPressedCommands  map[sf.KeyCode]KeyCommand
	KeyReleasedCommands map[sf.KeyCode]KeyCommand
	// contains filtered or unexported fields
}

KeyboardHandler : functions to call whe na key is pressed and released

func GenInputHandler

func GenInputHandler() *KeyboardHandler

GenInputHandler : Creates a Handler for commands

func (*KeyboardHandler) ClearKeyPressedCommand

func (handler *KeyboardHandler) ClearKeyPressedCommand(code sf.KeyCode)

ClearKeyPressedCommand : Clear function ofr this key

func (*KeyboardHandler) ClearKeyReleasedCommand

func (handler *KeyboardHandler) ClearKeyReleasedCommand(code sf.KeyCode)

ClearKeyReleasedCommand : Clear function for this key

func (*KeyboardHandler) RegisterKeyPressedCommand

func (handler *KeyboardHandler) RegisterKeyPressedCommand(code sf.KeyCode, cmd KeyCommand)

RegisterKeyPressedCommand : call htis function when a key si pressed

func (*KeyboardHandler) RegisterKeyReleasedCommand

func (handler *KeyboardHandler) RegisterKeyReleasedCommand(code sf.KeyCode, cmd KeyCommand)

RegisterKeyReleasedCommand : call this function when a key is released

type KeyboardSet

type KeyboardSet struct {
	// contains filtered or unexported fields
}

KeyboardSet : Set of KeyboardHandlers. Technically only need 1 but it's usefull for grouping

func GenKeyboardSet

func GenKeyboardSet() *KeyboardSet

GenKeyboardSet : Creates a New KeyboardSet

func (*KeyboardSet) AddHandler

func (set *KeyboardSet) AddHandler(handler *KeyboardHandler)

AddHandler : adds a Handler to a keyboardSet

func (*KeyboardSet) KeyPressed

func (set *KeyboardSet) KeyPressed(code sf.KeyCode)

KeyPressed : Says a key should be pressed

func (*KeyboardSet) KeyReleased

func (set *KeyboardSet) KeyReleased(code sf.KeyCode)

KeyReleased : Says a key should be released

func (*KeyboardSet) RemoveHandler

func (set *KeyboardSet) RemoveHandler(handler *KeyboardHandler)

RemoveHandler : remove a KeybaordHandler from a keyboardSet

type MailBox

type MailBox interface {
	PostMessage(msg Message)
	RecieveMessage(msg Message)
	Remove()
	SetOffice(office *PostOffice)
	GetOffice() *PostOffice
	GetAddress() Address
	SetAddress(Address)
}

MailBox : Interface for accepting and recieve message

type Message

type Message struct {
	Message MessageType
	Content interface{}
}

Message : Contains two fields, MessageType and the pointer to the object you are dealing with. Used for RPC.

type MessageType

type MessageType string

MessageType : String Defining the Message

type PhysicsEngine

type PhysicsEngine struct {
	BasicMailBox
	// contains filtered or unexported fields
}

PhysicsEngine : Wrapper around chipmunk engine

func (*PhysicsEngine) AddEntities

func (engine *PhysicsEngine) AddEntities(list []*Entity)

AddEntities : Convienece function to add a bunch of entities

func (*PhysicsEngine) AddEntity

func (engine *PhysicsEngine) AddEntity(e *Entity)

AddEntity : Add Entity to phsics space

func (*PhysicsEngine) ChangeScene

func (engine *PhysicsEngine) ChangeScene(s *Scene)

ChangeScene : Changes the Current Scene

func (*PhysicsEngine) GetSpace

func (engine *PhysicsEngine) GetSpace() *chipmunk.Space

GetSpace : Get chipmunk space

func (*PhysicsEngine) RecieveMessage

func (engine *PhysicsEngine) RecieveMessage(msg Message)

RecieveMessage : RecieveMessage function for Physics Engine

func (*PhysicsEngine) SetDebug

func (engine *PhysicsEngine) SetDebug(debug bool)

SetDebug : Sets Debug mode of Physics Engine

type PhysicsEngineConfig

type PhysicsEngineConfig struct {
	Debug   bool
	Gravity vect.Vect
}

PhysicsEngineConfig : Configuration for the Physics Engine

type PostOffice

type PostOffice struct {
	// contains filtered or unexported fields
}

PostOffice : Manages MailBoxs

func NewPostOffice

func NewPostOffice() *PostOffice

NewPostOffice : Creates a NewPostOffice

func (*PostOffice) Add

func (office *PostOffice) Add(box MailBox)

Add : Adds a MailBox to this office

func (*PostOffice) Broadcast

func (office *PostOffice) Broadcast(msg Message)

Broadcast : Send a message to every box

func (*PostOffice) IsSubscribed

func (office *PostOffice) IsSubscribed(sender Address, reciever Address, msg MessageType) bool

IsSubscribed : See if a given mailbox is the subscriber for a message on another

func (*PostOffice) RecieveMessage

func (office *PostOffice) RecieveMessage(sender Address, msg Message)

RecieveMessage : Called whenever a MailBox post. Sends this Message out to Subscribed MailBoxs

func (*PostOffice) Remove

func (office *PostOffice) Remove(box Address)

Remove : PostOffice will never send this MailBox another message

func (*PostOffice) Subscribe

func (office *PostOffice) Subscribe(sender Address, reciever Address, msg MessageType)

Subscribe : Tells a MailBox to Listen to a specific message from this mailbox

func (*PostOffice) UnSubscribe

func (office *PostOffice) UnSubscribe(sender Address, reciever Address, msg MessageType)

UnSubscribe : Removes Subscriber for a given message and MailBox

type RectangleShape

type RectangleShape sf.RectangleShape

RectangleShape : Wrapper around sfml Object

type Scene

type Scene struct {
	Name string

	Awake  func()
	Start  func()
	Update func(time.Duration)

	BasicMailBox
	// contains filtered or unexported fields
}

Scene : Everything that is being rendered

func SceneFromSceneDef

func SceneFromSceneDef(def *SceneDef) (*Scene, error)

SceneFromSceneDef : Creates a new scene given a definition

func (*Scene) AddEntity

func (s *Scene) AddEntity(e *Entity)

AddEntity : AddEntity to the Scene

func (*Scene) Draw

func (s *Scene) Draw(target sf.RenderTarget, renderStates sf.RenderStates)

Draw : Draws the scene to a render target

func (*Scene) GetEntities

func (s *Scene) GetEntities() []*Entity

GetEntities : Gets all entities in scene

func (*Scene) GetEntityByName

func (s *Scene) GetEntityByName(name string) (*Entity, bool)

GetEntityByName : Returns an entity in the scene with that name

func (*Scene) RecalculateScale

func (s *Scene) RecalculateScale()

RecalculateScale : Changes the of every entity

func (*Scene) RecieveMessage

func (s *Scene) RecieveMessage(msg Message)

RecieveMessage : Handles Message

func (*Scene) SetZIndex

func (s *Scene) SetZIndex(name string, index int)

SetZIndex : SetsZIndex of a node

type SceneDef

type SceneDef struct {
	Name     string
	Entities []SceneDefEntity
}

SceneDef : Informaiton to Create a scene from a JSON Template

func ParseSceneDef

func ParseSceneDef(g *Game, sceneName, sceneString string) (*SceneDef, error)

ParseSceneDef : Get SceneDef from string definition

type SceneDefEntity

type SceneDefEntity struct {
	Name               string
	Parent             string
	Prefab             string
	TransformArguments map[string]interface{}
	Position           Vector
	Scale              Vector
	Rotation           float32
}

SceneDefEntity : Defines an Entity within the scene

type Shape

type Shape interface {
	GetOrigin() sf.Vector2f
	SetOrigin(sf.Vector2f)

	GetOutlineThickness() float32
	SetOutlineThickness(float32)

	GetOutlineColor() sf.Color
	SetOutlineColor(sf.Color)

	GetFillColor() sf.Color
	SetFillColor(sf.Color)
}

Shape : Group of Functions all Shapes have

type Sprite

type Sprite sf.Sprite

Sprite : Wrapper around sfml Object

type Text

type Text sf.Text

Text : Wrapper around sfml Object

type Transformer

type Transformer interface {
	sf.Drawer
	sf.Transformer
}

Transformer : Wrapper arround sfml Transformer

func CircleShapeFromArguments

func CircleShapeFromArguments(args map[string]interface{}) (Transformer, error)

CircleShapeFromArguments : Generates CircleShape from Arguments field of Prefab

func ConvexShapeFromArguments

func ConvexShapeFromArguments(args map[string]interface{}) (Transformer, error)

ConvexShapeFromArguments : Generates ConvexShape from Arguments field of Prefab

func RectangleShapeFromArguments

func RectangleShapeFromArguments(args map[string]interface{}) (Transformer, error)

RectangleShapeFromArguments : Generates RectangleShape from Arguments field of Prefab

func SpriteFromArguments

func SpriteFromArguments(args map[string]interface{}) (Transformer, error)

SpriteFromArguments : Generates sprite from Arguments field of Prefab TODO : Get Texture

func TextFromArguments

func TextFromArguments(args map[string]interface{}) (Transformer, error)

TextFromArguments : Generates Text from Arguments field of Prefab TODO : Get fonts

func TransformerFromTranformerPrefab

func TransformerFromTranformerPrefab(t TransformerPrefab) (Transformer, error)

TransformerFromTranformerPrefab : Returns Transformer from Transform Prefab

type TransformerPrefab

type TransformerPrefab struct {
	Kind      string
	Arguments map[string]interface{}
}

TransformerPrefab : Info to create a Transformer from JSON Prefab

type Vector

type Vector struct {
	X, Y float32
}

Vector : A 1x1 Vector reprecents a square whose width is 1 100th of the screen

func ArgAsVector

func ArgAsVector(arg interface{}) (Vector, bool)

ArgAsVector Converts an interface from a JSON Parser to a Vector2f

func ChipmunkFloatToVector

func ChipmunkFloatToVector(x, y vect.Float) Vector

ChipmunkFloatToVector : New float

func ChipmunkVectorToVector

func ChipmunkVectorToVector(vec vect.Vect) Vector

ChipmunkVectorToVector : New Vector

func Vector2fToVector

func Vector2fToVector(vec sf.Vector2f) Vector

Vector2fToVector : Converts a Vector2f to a Vector

func Vector2uToVector

func Vector2uToVector(vec sf.Vector2u) Vector

Vector2uToVector : Converts a Vector2u to a Vector

func (*Vector) ToChipmunk

func (v *Vector) ToChipmunk() vect.Vect

ToChipmunk : Converts a Vector to an sfml vector

func (*Vector) ToSFML

func (v *Vector) ToSFML() sf.Vector2f

ToSFML : Converts a Vector to an sfml vector

type Window

type Window struct {
	Ticker     *time.Ticker
	ClearColor sf.Color

	BasicMailBox
	// contains filtered or unexported fields
}

Window : Wrapper around a SFML RenderWindow Handles input and drawing scenes

func (*Window) ChangeScene

func (w *Window) ChangeScene(s *Scene)

ChangeScene : Changes current scene

func (*Window) GetInputCollection

func (w *Window) GetInputCollection() *InputCollection

GetInputCollection : Retruns the InputCollection for this scene

func (*Window) Init

func (w *Window) Init()

Init : Subscribes to messages and other Stuff

func (*Window) RecieveMessage

func (w *Window) RecieveMessage(msg Message)

RecieveMessage : Messages This Window should Recieve

func (*Window) Run

func (w *Window) Run()

Run : Plays the window

type WindowConfig

type WindowConfig struct {
	Width      uint
	Height     uint
	ClearColor sf.Color
	Title      string
}

WindowConfig : Creates A Window given the configuration

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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