Skip to content

Commit 58e9c02

Browse files
authored
deprecate FlxButtonPlus and add getter (#472)
1 parent 29cc58f commit 58e9c02

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

flixel/addons/ui/FlxButtonPlus.hx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package flixel.addons.ui;
22

33
#if FLX_MOUSE
4-
import openfl.events.MouseEvent;
5-
import openfl.geom.Rectangle;
6-
import openfl.Lib;
7-
import flixel.addons.display.FlxExtendedMouseSprite;
84
import flixel.FlxCamera;
95
import flixel.FlxG;
106
import flixel.FlxSprite;
7+
import flixel.addons.display.FlxExtendedMouseSprite;
118
import flixel.graphics.FlxGraphic;
129
import flixel.group.*;
10+
import flixel.math.FlxMath;
1311
import flixel.text.FlxText;
1412
import flixel.util.FlxColor;
1513
import flixel.util.FlxDestroyUtil;
1614
import flixel.util.FlxGradient;
17-
import flixel.math.FlxMath;
15+
import openfl.Lib;
16+
import openfl.events.MouseEvent;
17+
import openfl.geom.Rectangle;
1818

1919
// TODO: Port to use touch as well
2020

@@ -24,6 +24,7 @@ import flixel.math.FlxMath;
2424
* @link http://www.photonstorm.com
2525
* @author Richard Davey / Photon Storm
2626
*/
27+
@:deprecated("FlxButtonPlus is deprecated, use FLxButton, instead")
2728
class FlxButtonPlus extends #if (flixel < version("5.7.0")) FlxSpriteGroup #else FlxSpriteContainer #end
2829
{
2930
public static inline var NORMAL:Int = 0;
@@ -69,7 +70,7 @@ class FlxButtonPlus extends #if (flixel < version("5.7.0")) FlxSpriteGroup #else
6970
/**
7071
* If this button has text, set this to change the value
7172
*/
72-
public var text(never, set):String;
73+
public var text(get, set):String;
7374

7475
/**
7576
* Shows the current state of the button.
@@ -371,6 +372,14 @@ class FlxButtonPlus extends #if (flixel < version("5.7.0")) FlxSpriteGroup #else
371372
#end
372373
}
373374

375+
function get_text():String
376+
{
377+
if (textNormal != null)
378+
return textNormal.text;
379+
380+
return null;
381+
}
382+
374383
function set_text(NewText:String):String
375384
{
376385
if ((textNormal != null) && (textNormal.text != NewText))

0 commit comments

Comments
 (0)