Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomDrawFunc ¶
CustomDrawFunc is the callback function to provide additional functionality when drawing an Option. This is called after the main shape is drawn.
type Drawable ¶
type Drawable interface { Draw(imd *imdraw.IMDraw) GetBody() *chipmunk.Body GetOptions() ObjectOptions }
Drawable interface for any drawable Object
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object represents an object inside the World
func NewCircle ¶
func NewCircle(options ObjectOptions) Object
NewCircle creates a new Object that represents a circle / disc / ball
func NewObject ¶
func NewObject(body *chipmunk.Body, options ObjectOptions) Object
NewObject creates a new Object for the provided Body and ObjectOptions
func NewObjectWithShape ¶
func NewObjectWithShape(shape *chipmunk.Shape, options ObjectOptions) Object
NewObjectWithShape creates a new Object for the provided Shape and ObjectOptions
func (Object) GetOptions ¶
func (o Object) GetOptions() ObjectOptions
GetOptions returns the ObjectOptions that were used to create the Object
type ObjectBodyOptions ¶
type ObjectBodyOptions struct { StaticBody bool Position vect.Vect Angle vect.Float Mass vect.Float Velocity vect.Vect Elasticity vect.Float Friction vect.Float Type chipmunk.ShapeType CircleOptions ObjectCircleOptions BoxOptions ObjectBoxOptions }
ObjectBodyOptions holds the physical attributes for the Object
type ObjectBoxOptions ¶
ObjectBoxOptions holds the attributes for a Box object
type ObjectCircleOptions ¶
type ObjectCircleOptions struct {
Radius float32
}
ObjectCircleOptions holds the attributes for a Circle object
type ObjectOptions ¶
type ObjectOptions struct { Color color.Color Thickness float64 CustomDrawFunc []CustomDrawFunc BodyOptions ObjectBodyOptions }
ObjectOptions for creating a new Object