Show / Hide Table of Contents

Class Texture

Drawable textures

Inheritance
System.Object
Texture
Namespace: Mannequin.Bindings
Assembly: Collapse.dll
Syntax
public class Texture : object
Examples

Draw a sprite for 2 seconds whenever a Living is damaged.

Mannequin:Import("Texture")
Mannequin:Import("Event")

local sprite = nil

Event.On("ContentReady", function()
    sprite = Texture("gui/bt.fistred")
end)

Event.On("LivingAttacked", function(attacker, victim)
    sprite:Draw(attacker.Position, 2000)
end)

Constructors

Texture(String)

Load a Texture.

Declaration
public Texture(string location)
Parameters
Type Name Description
System.String location

The Texture to load.

Properties

Name

The filename of this texture, without the .xnb.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Methods

DrawOnScene(Point, Scene, Int32, Int32)

Draw a Texture on a Scene.

Declaration
public TextureDrawController DrawOnScene(Point point, Scene scene, int duration = 0, int layer = 1)
Parameters
Type Name Description
Point point

The Point to draw the texture at

Scene scene

The Scene to draw the texture on

System.Int32 duration

How long, in ms, this texture should continue to be drawn

System.Int32 layer

The layer this texture should be drawn on; lower numbers are drawn before higher numbers

Returns
Type Description
TextureDrawController

A TextureDrawController linked to this draw request

Back to top © 2020 Anarkis Gaming. All rights reserved. Generated by DocFX