Created
March 28, 2017 01:53
-
-
Save buckle2000/1a66acb34669974dab74e8f0724cd44d to your computer and use it in GitHub Desktop.
haxe cannot click transparent sprite only in flash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import flixel.FlxG; | |
import flixel.FlxSprite; | |
import flixel.FlxState; | |
import flixel.util.FlxColor; | |
class PlayState extends FlxState | |
{ | |
var square: FlxSprite; | |
var iter = FlxColor.colorLookup.iterator(); | |
override public function create():Void | |
{ | |
square = new FlxSprite(0, 0); | |
square.makeGraphic(40, 40, FlxColor.TRANSPARENT); | |
add(square); | |
super.create(); | |
} | |
override public function update(elapsed:Float):Void | |
{ | |
super.update(elapsed); | |
if (FlxG.mouse.justPressed && FlxG.mouse.overlaps(square)) { | |
square.makeGraphic(40, 40, FlxColor.WHITE); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment