Fixed HIT and DOWN constants in input class for compatibility with previous flixel versions

Strict

Import mojo

Import flixel.flxg
Import flixel.system.replay.keyrecord

Class Input Abstract

Private
	Global _Map:Int[KEY_CLOSE + 1]

	Field _from:Int
	Field _to:Int

Public
	Method New(fromKey:Int, toKey:Int)
		_from = fromKey
		_to = toKey + 1
	End Method

	Method Destroy:Void()
		Reset()
		_from = 0
		_to = 0
	End Method

	Method Update:Void()
		Local i:Int = _from

		While (i < _to)
			If _Map[i] = OFF Then
                If KeyHit(i) Then _Map[i] = HIT

            ElseIf _Map[i] = HIT Then
                If KeyDown(i) Then
                    _Map[i] = DOWN
                Else
                    _Map[i] = UP
                End If

            Else
                If _Map[i] = UP Then
                   _Map[i] = OFF
                Else
                    If Not KeyDown(i) Then _Map[i] = UP
                End If
            End If

			i += 1
		Wend
	End Method

	Method Update:Void(x:Float, y:Float)
		Return
	End Method

	Method Reset:Void()
		Local i:Int = _from

		While (i < _to)
			_Map[i] = OFF
			i += 1
		Wend
	End Method

	Method Reset:Void(fromKey:Int, toKey:Int)
		Local i:Int = fromKey

		While (i < toKey)
			_Map[i] = OFF
			i += 1
		Wend
	End Method

	Method Pressed:Bool()
		Return False
	End Method

	Method JustPressed:Bool()
		Return False
	End Method

	Method JustReleased:Bool()
		Return False
	End Method

	Method Used:Bool()
		Return False
	End Method

	Method Pressed:Bool(key:Int)
		Return _Map[key] > OFF
	End Method

	Method JustPressed:Bool(key:Int)
		Return _Map[key] = HIT
	End Method

	Method JustReleased:Bool(key:Int)
		Return _Map[key] = UP
	End Method

	Method Used:Bool(key:Int)
		Return _Map[key] <> OFF
	End Method

	Method RecordKeys:Stack<KeyRecord>(data:Stack<KeyRecord> = Null)
		Local i:Int = _from

		While (i < _to)
			If (_Map[i] = OFF) Then
				i += 1
				Continue
			End If

			If (data = Null) Then
				data = New Stack<KeyRecord>()
			End If

			data.Push(New KeyRecord(i, _Map[i]))
		Wend

		Return data
	End Method

	Method PlaybackKeys:Void(record:Stack<KeyRecord>)
		Local i:Int = 0
		Local l:Int = record.Length()
		Local kr:KeyRecord

		While (i < l)
			kr = record.Get(i)
			_Map[kr.code] = kr.value
			i += 1
		Wend
	End Method

	Method Any:Bool()
		Local i:Int = _from

		While (i < _to)
			If (_Map[i] <> OFF) Return True
			i += 1
		Wend

		Return False
	End Method

	Private

	Const OFF:Int = 0

    Const HIT:Int = 2

    Const DOWN:Int = 1

    Const UP:Int = -1

End Class

Strict

Import mojo

Import flixel.flxg
Import flixel.system.replay.keyrecord

Class Input Abstract

Private
	Global _Map:Int[KEY_CLOSE + 1]

	Field _from:Int
	Field _to:Int

Public
	Method New(fromKey:Int, toKey:Int)
		_from = fromKey
		_to = toKey + 1
	End Method

	Method Destroy:Void()
		Reset()
		_from = 0
		_to = 0
	End Method

	Method Update:Void()
		Local i:Int = _from

		While (i < _to)
			If _Map[i] = OFF Then
                If KeyHit(i) Then _Map[i] = HIT

            ElseIf _Map[i] = HIT Then
                If KeyDown(i) Then
                    _Map[i] = DOWN
                Else
                    _Map[i] = UP
                End If

            Else
                If _Map[i] = UP Then
                   _Map[i] = OFF
                Else
                    If Not KeyDown(i) Then _Map[i] = UP
                End If
            End If

			i += 1
		Wend
	End Method

	Method Update:Void(x:Float, y:Float)
		Return
	End Method

	Method Reset:Void()
		Local i:Int = _from

		While (i < _to)
			_Map[i] = OFF
			i += 1
		Wend
	End Method

	Method Reset:Void(fromKey:Int, toKey:Int)
		Local i:Int = fromKey

		While (i < toKey)
			_Map[i] = OFF
			i += 1
		Wend
	End Method

	Method Pressed:Bool()
		Return False
	End Method

	Method JustPressed:Bool()
		Return False
	End Method

	Method JustReleased:Bool()
		Return False
	End Method

	Method Used:Bool()
		Return False
	End Method

	Method Pressed:Bool(key:Int)
		Return _Map[key] > OFF
	End Method

	Method JustPressed:Bool(key:Int)
		Return _Map[key] = HIT
	End Method

	Method JustReleased:Bool(key:Int)
		Return _Map[key] = UP
	End Method

	Method Used:Bool(key:Int)
		Return _Map[key] <> OFF
	End Method

	Method RecordKeys:Stack<KeyRecord>(data:Stack<KeyRecord> = Null)
		Local i:Int = _from

		While (i < _to)
			If (_Map[i] = OFF) Then
				i += 1
				Continue
			End If

			If (data = Null) Then
				data = New Stack<KeyRecord>()
			End If

			data.Push(New KeyRecord(i, _Map[i]))
		Wend

		Return data
	End Method

	Method PlaybackKeys:Void(record:Stack<KeyRecord>)
		Local i:Int = 0
		Local l:Int = record.Length()
		Local kr:KeyRecord

		While (i < l)
			kr = record.Get(i)
			_Map[kr.code] = kr.value
			i += 1
		Wend
	End Method

	Method Any:Bool()
		Local i:Int = _from

		While (i < _to)
			If (_Map[i] <> OFF) Return True
			i += 1
		Wend

		Return False
	End Method

	Private

	Const OFF:Int = 0

    Const HIT:Int = 1

    Const DOWN:Int = 2

    Const UP:Int = -1

End Class


TimeManager plugin ported

TimeManager plugin ported

Strict

Import flixel

Class TimerManager Extends FlxBasic

Private
	Field _timers:Stack<FlxTimer>

Public
	Method New()
		_timers = New Stack<FlxTimer>()
		visible = False
	End Method

	Method Destroy:Void()
		Clear()
		_timers = Null
	End Method

	Method Update:Void()
		Local i:Int = _timers.Length() - 1
		Local timer:FlxTimer

		While (i >= 0)
			timer = _timers.Get(i)
			If (timer != Null And Not timer.paused And Not timer.finished And timer.time > 0) Then
				timer.Update()
			End If
			i-=1
		Wend
	End Method

	Method Add:Void(timer:FlxTimer)
		_timers.Push(timer)
	End Method

	Method Remove:Void(timer:FlxTimer)
		_timers.RemoveEach(timer)
	End Method

	Method Clear:Void()
		Local i:Int = _timers.Length() - 1
		Local timer:FlxTimer

		While (i >= 0)
			timer = _timers.Get(i)
			If (timer != Null) timer.Destroy()
			i-=1
		Wend

		_timers.Clear()
	End Method

End Class

Strict

Import flixel

Class TimerManager Extends FlxBasic

End Class


Default friction value for particle fixed

Strict

Import flxsprite

Class FlxParticle Extends FlxSprite

	Global ClassObject:FlxClass = New FlxParticleClass()

	Field lifespan:Float

	Field friction:Float

	Method New()
		Super.New()
		lifespan = 0
		friction = 500
	End Method

	Method Update:Void()
		If (lifespan <= 0) Return

		lifespan -= FlxG.Elapsed

		If (lifespan <=0) Then
			Kill()
		End If

		If (touching) Then
			If (angularVelocity <> 0) Then
				angularVelocity = -angularVelocity
			End If
		End If

		If (acceleration.y > 0) Then
			If (touching & FLOOR) Then
				drag.x = friction

				If (Not (wasTouching & FLOOR)) Then
					If (velocity.y < -elasticity * 10) Then
						If (angularVelocity <> 0) Then
							angularVelocity *= -elasticity
						End If
					Else
						velocity.y = 0
						angularVelocity = 0
					End If
				End If
			Else
				drag.x = 0
			End If
		End If
	End Method

	Method OnEmit:Void()
	End Method

End Class

Private
Class FlxParticleClass Implements FlxClass

	Method CreateInstance:Object()
		Return New FlxParticle()
	End Method

	Method InstanceOf:Bool(object:Object)
		Return (FlxParticle(object) <> Null)
	End Method

End Class

Strict

Import flxsprite

Class FlxParticle Extends FlxSprite

	Global ClassObject:FlxClass = New FlxParticleClass()

	Field lifespan:Float

	Field friction:Float

	Method New()
		Super.New()
		lifespan = 0
		friction = 0
	End Method

	Method Update:Void()
		If (lifespan <= 0) Return

		lifespan -= FlxG.Elapsed

		If (lifespan <=0) Then
			Kill()
		End If

		If (touching) Then
			If (angularVelocity <> 0) Then
				angularVelocity = -angularVelocity
			End If
		End If

		If (acceleration.y > 0) Then
			If (touching & FLOOR) Then
				drag.x = friction

				If (Not (wasTouching & FLOOR)) Then
					If (velocity.y < -elasticity * 10) Then
						If (angularVelocity <> 0) Then
							angularVelocity *= -elasticity
						End If
					Else
						velocity.y = 0
						angularVelocity = 0
					End If
				End If
			Else
				drag.x = 0
			End If
		End If
	End Method

	Method OnEmit:Void()
	End Method

End Class

Private
Class FlxParticleClass Implements FlxClass

	Method CreateInstance:Object()
		Return New FlxParticle()
	End Method

	Method InstanceOf:Bool(object:Object)
		Return (FlxParticle(object) <> Null)
	End Method

End Class


Asset string now load sting

Asset string now load sting

Strict

Import flixel.flxextern
Import flixel.flxtext

Import flixel.system.flxfont

Class FlxAssetsManager

Private
	Global _fonts:StringMap<FlxFont>[]
	Global _images:StringMap<String>
	Global _sounds:StringMap<String>
	Global _music:StringMap<String>
	Global _cursors:StringMap<String>
	Global _strings:StringMap<String>

Public
	Function Init:Void()
		_fonts = New StringMap<FlxFont>[FlxText.DRIVER_ANGELFONT+1]

		Local l:Int = _fonts.Length()
		For Local i:Int = 0 Until l
			_fonts[i] = New StringMap<FlxFont>()
		Next

		_images = New StringMap<String>()
		_sounds = New StringMap<String>()
		_music = New StringMap<String>()
		_cursors = New StringMap<String>()
		_strings = New StringMap<String>()
	End Function

	Function AddFont:FlxFont(name:String, driver:Int = FlxText.DRIVER_NATIVE)
		Local font:FlxFont = _fonts[driver].Get(name)
		If (font <> Null) Return font

		font = New FlxFont(name)
		_fonts[driver].Set(name, font)

		Return font
	End Function

	Function RemoveFont:Void(name:String, size:Int, driver:Int = FlxText.DRIVER_NATIVE)
		_fonts[driver].RemoveFontPath(name, size)
	End Function

	Function GetFonts:StringMap<FlxFont>(driver:Int = FlxText.DRIVER_NATIVE)
		Return _fonts[driver]
	End Function

	Function GetFont:FlxFont(name:String, driver:Int = FlxText.DRIVER_NATIVE)
		Return _fonts[driver].Get(name)
	End Function

	Function AddImage:Void(name:String, path:String)
		_images.Set(name, path)
	End Function

	Function RemoveImage:Void(name:String)
		_images.Remove(name)
	End Function

	Function GetImagePath:String(name:String)
		Return _images.Get(name)
	End Function

	Function AddSound:Void(name:String, path:String)
		_sounds.Set(name, path)
	End Function

	Function RemoveSound:Void(name:String)
		_sounds.Remove(name)
	End Function

	Function GetSoundPath:String(name:String)
		Return _sounds.Get(name)
	End Function

	Function AddMusic:Void(name:String, path:String)
		_music.Set(name, path)
	End Function

	Function RemoveMusic:Void(name:String)
		_music.Remove(name)
	End Function

	Function GetMusicPath:String(name:String)
		Return _music.Get(name)
	End Function

	Function AddCursor:Void(cursor:String, path:String)
		_cursors.Set(cursor, path)
	End Function

	Function RemoveCursor:Void(cursor:String)
		_cursors.Remove(cursor)
	End Function

	Function GetCursorPath:String(cursor:String)
		Return _cursors.Get(cursor)
	End Function

	Function AddString:Void(string:String, path:String)
		_strings.Set(string, path)
	End Function

	Function RemoveString:Void(string:String)
		_strings.Remove(string)
	End Function

	Function GetString:String(string:String)
		Return LoadString(_strings.Get(string))
	End Function

End Class

Strict

Import flixel.flxextern
Import flixel.flxtext

Import flixel.system.flxfont

Class FlxAssetsManager

Private
	Global _fonts:StringMap<FlxFont>[]
	Global _images:StringMap<String>
	Global _sounds:StringMap<String>
	Global _music:StringMap<String>
	Global _cursors:StringMap<String>
	Global _strings:StringMap<String>

Public
	Function Init:Void()
		_fonts = New StringMap<FlxFont>[FlxText.DRIVER_ANGELFONT+1]

		Local l:Int = _fonts.Length()
		For Local i:Int = 0 Until l
			_fonts[i] = New StringMap<FlxFont>()
		Next

		_images = New StringMap<String>()
		_sounds = New StringMap<String>()
		_music = New StringMap<String>()
		_cursors = New StringMap<String>()
		_strings = New StringMap<String>()
	End Function

	Function AddFont:FlxFont(name:String, driver:Int = FlxText.DRIVER_NATIVE)
		Local font:FlxFont = _fonts[driver].Get(name)
		If (font <> Null) Return font

		font = New FlxFont(name)
		_fonts[driver].Set(name, font)

		Return font
	End Function

	Function RemoveFont:Void(name:String, size:Int, driver:Int = FlxText.DRIVER_NATIVE)
		_fonts[driver].RemoveFontPath(name, size)
	End Function

	Function GetFonts:StringMap<FlxFont>(driver:Int = FlxText.DRIVER_NATIVE)
		Return _fonts[driver]
	End Function

	Function GetFont:FlxFont(name:String, driver:Int = FlxText.DRIVER_NATIVE)
		Return _fonts[driver].Get(name)
	End Function

	Function AddImage:Void(name:String, path:String)
		_images.Set(name, path)
	End Function

	Function RemoveImage:Void(name:String)
		_images.Remove(name)
	End Function

	Function GetImagePath:String(name:String)
		Return _images.Get(name)
	End Function

	Function AddSound:Void(name:String, path:String)
		_sounds.Set(name, path)
	End Function

	Function RemoveSound:Void(name:String)
		_sounds.Remove(name)
	End Function

	Function GetSoundPath:String(name:String)
		Return _sounds.Get(name)
	End Function

	Function AddMusic:Void(name:String, path:String)
		_music.Set(name, path)
	End Function

	Function RemoveMusic:Void(name:String)
		_music.Remove(name)
	End Function

	Function GetMusicPath:String(name:String)
		Return _music.Get(name)
	End Function

	Function AddCursor:Void(cursor:String, path:String)
		_cursors.Set(cursor, path)
	End Function

	Function RemoveCursor:Void(cursor:String)
		_cursors.Remove(cursor)
	End Function

	Function GetCursorPath:String(cursor:String)
		Return _cursors.Get(cursor)
	End Function

	Function AddString:Void(string:String, path:String)
		_strings.Set(string, path)
	End Function

	Function RemoveString:Void(string:String)
		_strings.Remove(string)
	End Function

	Function GetStringPath:String(string:String)
		Return _strings.Get(string)
	End Function

End Class


Changed FlxAssetsManager fonts managment

Strict

Import flixel.flxextern
Import flixel.flxtext

Import flixel.system.flxfont

Class FlxAssetsManager

Private
	Global _Fonts:StringMap<FlxFont>
	Global _Images:StringMap<String>
	Global _Sounds:StringMap<String>
	Global _Music:StringMap<String>
	Global _Cursors:StringMap<String>
	Global _Strings:StringMap<String>

Public
	Function Init:Void()
		_Fonts = New StringMap<FlxFont>()
		_Images = New StringMap<String>()
		_Sounds = New StringMap<String>()
		_Music = New StringMap<String>()
		_Cursors = New StringMap<String>()
		_Strings = New StringMap<String>()
	End Function

	Function AddFont:FlxFont(name:String)
		Local font:FlxFont = _Fonts.Get(name)
		If (font <> Null) Return font

		font = New FlxFont(name)
		_Fonts.Set(name, font)

		Return font
	End Function

	Function RemoveFont:Void(name:String)
		_Fonts.Remove(name)
	End Function

	Function GetFonts:StringMap<FlxFont>()
		Return _Fonts
	End Function

	Function GetFont:FlxFont(name:String)
		Return _Fonts.Get(name)
	End Function

	Function AddImage:Void(name:String, path:String)
		_Images.Set(name, path)
	End Function

	Function RemoveImage:Void(name:String)
		_Images.Remove(name)
	End Function

	Function GetImagePath:String(name:String)
		Return _Images.Get(name)
	End Function

	Function AllImages:MapKeys<String, String>()
		Return _Images.Keys()
	End Function

	Function AddSound:Void(name:String, path:String)
		_Sounds.Set(name, path)
	End Function

	Function RemoveSound:Void(name:String)
		_Sounds.Remove(name)
	End Function

	Function GetSoundPath:String(name:String)
		Return _Sounds.Get(name)
	End Function

	Function AllSounds:MapKeys<String, String>()
		Return _Sounds.Keys()
	End Function

	Function AddMusic:Void(name:String, path:String)
		_Music.Set(name, path)
	End Function

	Function RemoveMusic:Void(name:String)
		_Music.Remove(name)
	End Function

	Function GetMusicPath:String(name:String)
		Return _Music.Get(name)
	End Function

	Function AllMusic:MapKeys<String, String>()
		Return _Music.Keys()
	End Function

	Function AddCursor:Void(cursor:String, path:String)
		_Cursors.Set(cursor, path)
	End Function

	Function RemoveCursor:Void(cursor:String)
		_Cursors.Remove(cursor)
	End Function

	Function GetCursorPath:String(cursor:String)
		Return _Cursors.Get(cursor)
	End Function

	Function AllCursors:MapKeys<String, String>()
		Return _Cursors.Keys()
	End Function

	Function AddString:Void(name:String, path:String)
		_Strings.Set(name, path)
	End Function

	Function RemoveString:Void(name:String)
		_Strings.Remove(name)
	End Function

	Function GetString:String(name:String)
		Return LoadString(_Strings.Get(name))
	End Function

	Function AllStrings:MapKeys<String, String>()
		Return _Cursors.Keys()
	End Function

End Class

Strict

Import flixel.flxextern
Import flixel.flxtext

Import flixel.system.flxfont

Class FlxAssetsManager

Private
	Global _Fonts:StringMap<FlxFont>[]
	Global _Images:StringMap<String>
	Global _Sounds:StringMap<String>
	Global _Music:StringMap<String>
	Global _Cursors:StringMap<String>
	Global _Strings:StringMap<String>

Public
	Function Init:Void()
		_Fonts = New StringMap<FlxFont>[FlxText.DRIVER_ANGELFONT+1]

		Local l:Int = _Fonts.Length()
		For Local i:Int = 0 Until l
			_Fonts[i] = New StringMap<FlxFont>()
		Next

		_Images = New StringMap<String>()
		_Sounds = New StringMap<String>()
		_Music = New StringMap<String>()
		_Cursors = New StringMap<String>()
		_Strings = New StringMap<String>()
	End Function

	Function AddFont:FlxFont(name:String, driver:Int = FlxText.DRIVER_NATIVE)
		Local font:FlxFont = _Fonts[driver].Get(name)
		If (font <> Null) Return font

		font = New FlxFont(name)
		_Fonts[driver].Set(name, font)

		Return font
	End Function

	Function RemoveFont:Void(name:String, driver:Int = FlxText.DRIVER_NATIVE)
		_Fonts[driver].Remove(name)
	End Function

	Function GetFonts:StringMap<FlxFont>(driver:Int = FlxText.DRIVER_NATIVE)
		Return _Fonts[driver]
	End Function

	Function GetFont:FlxFont(name:String, driver:Int = FlxText.DRIVER_NATIVE)
		Return _Fonts[driver].Get(name)
	End Function

	Function AddImage:Void(name:String, path:String)
		_Images.Set(name, path)
	End Function

	Function RemoveImage:Void(name:String)
		_Images.Remove(name)
	End Function

	Function GetImagePath:String(name:String)
		Return _Images.Get(name)
	End Function

	Function AllImages:MapKeys<String, String>()
		Return _Images.Keys()
	End Function

	Function AddSound:Void(name:String, path:String)
		_Sounds.Set(name, path)
	End Function

	Function RemoveSound:Void(name:String)
		_Sounds.Remove(name)
	End Function

	Function GetSoundPath:String(name:String)
		Return _Sounds.Get(name)
	End Function

	Function AllSounds:MapKeys<String, String>()
		Return _Sounds.Keys()
	End Function

	Function AddMusic:Void(name:String, path:String)
		_Music.Set(name, path)
	End Function

	Function RemoveMusic:Void(name:String)
		_Music.Remove(name)
	End Function

	Function GetMusicPath:String(name:String)
		Return _Music.Get(name)
	End Function

	Function AllMusic:MapKeys<String, String>()
		Return _Music.Keys()
	End Function

	Function AddCursor:Void(cursor:String, path:String)
		_Cursors.Set(cursor, path)
	End Function

	Function RemoveCursor:Void(cursor:String)
		_Cursors.Remove(cursor)
	End Function

	Function GetCursorPath:String(cursor:String)
		Return _Cursors.Get(cursor)
	End Function

	Function AllCursors:MapKeys<String, String>()
		Return _Cursors.Keys()
	End Function

	Function AddString:Void(name:String, path:String)
		_Strings.Set(name, path)
	End Function

	Function RemoveString:Void(name:String)
		_Strings.Remove(name)
	End Function

	Function GetString:String(name:String)
		Return LoadString(_Strings.Get(name))
	End Function

	Function AllStrings:MapKeys<String, String>()
		Return _Cursors.Keys()
	End Function

End Class


Handle integers (0-255) as alpha value properly

Strict

Private

Import mojo.graphics

Public

Class Color
    Private

    Field oldColor:Color

    Public

    Field red:Float
    Field green:Float
    Field blue:Float
    Field _alpha:Float

    Method New(red:Float=255, green:Float=255, blue:Float=255, alpha:Float=1)
        Self.red = red
        Self.green = green
        Self.blue = blue
        Self.alpha = alpha
    End

    Method Reset:Void()
        red = 255
        green = 255
        blue = 255
        alpha = 1.0
    End

    Method Activate:Void()
        If Not oldColor Then oldColor = New Color(0, 0, 0, 0)

        Local colorStack:Float[] = GetColor()
        oldColor.red = colorStack[0]
        oldColor.green = colorStack[1]
        oldColor.blue = colorStack[2]
        oldColor.alpha = GetAlpha()

        Set(Self)
    End

    Method Deactivate:Void()
        If Not oldColor Then Return
        Set(oldColor)
        oldColor = Null
    End

    Method Copy:Color()
        Return New Color(red, green, blue, alpha)
    End

    Method alpha:Void(alpha:Int) Property
        _alpha = alpha
        If _alpha > 1 Then _alpha = 1 / 255 * _alpha
    End

    Method alpha:Void(alpha:Float) Property
        _alpha = alpha
        If _alpha > 1 Then _alpha = 1 / 255 * _alpha
    End

    Method alpha:Float() Property
        Return _alpha
    End

    Private

    Method Set:Void(color:Color)
        SetColor(color.red, color.green, color.blue)
        SetAlpha(color.alpha)
    End
End

Strict

Private

Import mojo.graphics

Public

Class Color
    Private

    Field oldColor:Color

    Public

    Field red:Float
    Field green:Float
    Field blue:Float
    Field alpha:Float

    Method New(red:Float=255, green:Float=255, blue:Float=255, alpha:Float=1)
        Self.red = red
        Self.green = green
        Self.blue = blue
        Self.alpha = alpha
    End

    Method Reset:Void()
        red = 255
        green = 255
        blue = 255
        alpha = 1.0
    End

    Method Activate:Void()
        If Not oldColor Then oldColor = New Color(0, 0, 0, 0)

        Local colorStack:Float[] = GetColor()
        oldColor.red = colorStack[0]
        oldColor.green = colorStack[1]
        oldColor.blue = colorStack[2]
        oldColor.alpha = GetAlpha()

        Set(Self)
    End

    Method Deactivate:Void()
        If Not oldColor Then Return
        Set(oldColor)
        oldColor = Null
    End

    Method Copy:Color()
        Return New Color(red, green, blue, alpha)
    End

    Private

    Method Set:Void(color:Color)
        SetColor(color.red, color.green, color.blue)
        SetAlpha(color.alpha)
    End
End