-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #647
Dev #647
Conversation
…iendly" tile layouts
Conflicts: flixel/ui/FlxClickArea.hx
@larsiusprime these are great additions, I think FlxClickArea and setCustomTileRemapStr are very usefull 👍 With the custom image index remapper could you provide a simple gist that we can test it with? |
@impaler I'm not so sure about the usefulness of |
Well, FlxClickArea is a FlxObject that has no graphical representation, but still responds properly to things like cameras and scrolling, so you don't even need a FlxSprite. There's a lot of times where you need an invisible clickable area, but not necessarily a graphical object. Also, with a bit of refactoring, FlxButton could be made to extend it perhaps. |
Also, @impaler how do I make a gist? |
Cool, incoming in a little bit. |
@larsiusprime thanks, also do you think it is necessary to have in core, is it worthwhile putting this feature into a utility class? it does add quite a bit of code to an already huge class. @Gama11 yes MouseEventManager plugin is great, however if you only need one or two of areas for a click event I suggest this is a cleaner way to do it without a plugin. Also its a good example of how things work, without the bloat of FlxButton. I made something similar to it before. |
This pull request now contains conflicts with some changes that were recently made. Please make a pull request, resolve conflicts, and commit the fixed code. |
Conflicts: flixel/system/frontEnds/BitmapFrontEnd.hx
Okay, I pulled latest flixel into my local repo, fixed the conflicts, then pushed to my repo. Also tried to address your comments. How 'bout now? |
*/ | ||
public var customTileRemap:Array<Int> = null; | ||
|
||
public var randomize_indeces:Array<Int> = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These randomize_* variables have no documentation, it's unclear what they are for, and how to use them.
Okay, hopefully this addresses those issues. |
@impaler: This could easily just go in Flixel-ui instead of flixel-core, I just figured other people would like to have a simple, easy-to-use "invisible button that you can just click." If there's significant resistance to it I'll stuff it in flixel-ui. |
} | ||
} | ||
|
||
if (randomize_indeces != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brace style doesn't match the rest of the file.
|
||
public var randomize_seed:Int = 0; //custom random seed, if any | ||
public var randomize_init:Int->Void = null; //custom random initializer function | ||
public var randomize_lambda:Void->Float = null; //custom random function, returns 0->1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this functionality is a bit complicated atm. First users need to know that they must prepare this data before calling loadMap. We should add a function to make using this easier. For example:
/*
* Documentation -> mention this needs to be called before loadMap()
*/
function prepareCustomTileMappings(mappings:Array<Int>, randomIndicies:Array<Int> = null, randomChoices<Array<Array<Int>> = null, randomLambda:Void->Float)
{
}
public var randomize_choices:Array<Array<Int>> = null; | ||
|
||
public var randomize_seed:Int = 0; //custom random seed, if any | ||
public var randomize_init:Int->Void = null; //custom random initializer function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think randomize_init
is not necessary within the engine. If users want to use a custom lambda function with a predetermined seed, they should prepare the data necessary to do this before calling loadMap.
Oops, I think I accidentally pushed this to flixel. Was it okay? |
I fixed bugs in BitmapFrontEnd, added more features to tilemap, as well as added my simplified invisible button trim-down, "FlxClickArea"