effects

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: Apache-2.0 Imports: 3 Imported by: 9

Documentation

Overview

Package effects include different components for adding effects

Index

Constants

This section is empty.

Variables

View Source
var Get = gets{

	AlternateColorState: func(e *goecs.Entity) AlternateColorState {
		return e.Get(TYPE.AlternateColorState).(AlternateColorState)
	},

	AlternateColor: func(e *goecs.Entity) AlternateColor {
		return e.Get(TYPE.AlternateColor).(AlternateColor)
	},

	Layer: func(e *goecs.Entity) Layer {
		return e.Get(TYPE.Layer).(Layer)
	},

	Hide: func(e *goecs.Entity) Hide {
		return e.Get(TYPE.Hide).(Hide)
	},
}

Get effect component

TYPE hold the reflect.Type for our effects components

Functions

This section is empty.

Types

type AlternateColor

type AlternateColor struct {
	From  color.Solid // From is color.Solid that we start from
	To    color.Solid // To is the color.Solid that we will end to
	Time  float32     // Time is how long will be get to go from From to To in seconds
	Delay float32     // Delay is how long will stay in the final To until switching again to To
}

AlternateColor effects will cycle between two colors From and To in given Time with an Optional Delay

type AlternateColorState

type AlternateColorState struct {
	CurrentTime float32     // CurrentTime time that this effects has been running
	Running     bool        // Running indicates if this effect is running
	From        color.Solid // From is color.Solid that we start from in the current state
	To          color.Solid // To is the color.Solid that we will end to the current state
}

AlternateColorState is the state for an effect

type Hide added in v0.1.12

type Hide struct{}

Hide indicates that this entity should be not draw

type Layer

type Layer struct {
	Depth float32 // Depth is the screen depth for this effects.Layer
}

Layer effect is use to render thins in a logical layer

Jump to

Keyboard shortcuts

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