Documentation ¶
Index ¶
- Constants
- Variables
- func Filter(query string) bool
- func InitCreatures(gameDir string, data []map[string]interface{}, ...) error
- func InitShapes(gameDir string, data []map[string]interface{}, ...) error
- type Animation
- type CursorDef
- type Direction
- type Edge
- type ImageInfo
- type Shape
- type ShapeMeta
- type TextureCoords
Constants ¶
View Source
const ANIMATION_ATTACK = 2
View Source
const ANIMATION_MOVE = 0
some pre-defined animations
View Source
const ANIMATION_STAND = 1
View Source
const MAX_SHAPES_PER_IMG = 0x100
Variables ¶
View Source
var AnimationNames map[string]int = map[string]int{ "move": ANIMATION_MOVE, "stand": ANIMATION_STAND, "attack": ANIMATION_ATTACK, }
but more can be added
View Source
var Cursors []CursorDef
View Source
var DIR_E = Direction(4)
View Source
var DIR_N = Direction(6)
View Source
var DIR_NE = Direction(5)
View Source
var DIR_NONE = Direction(8)
View Source
var DIR_NW = Direction(7)
View Source
var DIR_S = Direction(2)
View Source
var DIR_SE = Direction(3)
View Source
var DIR_SW = Direction(1)
View Source
var DIR_W = Direction(0)
View Source
var Directions = map[string]Direction{ "w": DIR_W, "sw": DIR_SW, "s": DIR_S, "se": DIR_SE, "e": DIR_E, "ne": DIR_NE, "n": DIR_N, "nw": DIR_NW, "": DIR_NONE, }
View Source
var FilteredShapes []*Shape
View Source
var Images []*ImageInfo
View Source
var Names map[string]int = map[string]int{}
View Source
var Shapes []*Shape
Functions ¶
func InitCreatures ¶
Types ¶
type Shape ¶
type Shape struct { Index int Name string Description string Group int Thumb, Image image.Image Size [3]float32 Tex *TextureCoords Fudge float32 AlphaMin float32 ImageIndex int ShapeMeta *ShapeMeta Edges map[string]map[string][]*Shape Offset [3]float32 EditorVisible bool Animations map[int]*Animation VertexShader string FragmentShader string Support bool SupportPos [][]bool IsExtra bool IsDraggable bool IsInteractive bool IsSaved bool Scale [3]float64 Adjust [2]float32 Light bool LightZ float32 IgnoreLight bool Marker bool OnHide int AnimatedShapes []*Shape Transparent bool VariantOf string VariantWeight float32 Variants []*Shape ExtraZ float32 // contains filtered or unexported fields }
func (*Shape) GetVariant ¶
get this shapes' variant using a weighted random distribution
type TextureCoords ¶
type TextureCoords struct { PixelOffset [2]float32 PixelDim [2]float32 TexOffset [2]float32 TexDim [2]float32 }
func NewTextureCoords ¶
func NewTextureCoords(imageBounds image.Rectangle, px, py, pw, ph float32) *TextureCoords
Click to show internal directories.
Click to hide internal directories.