-
Notifications
You must be signed in to change notification settings - Fork 6
FAQ
Check out this documentation, which lists some common tasks and best practices. The code samples in the demo repository might also be helpful.
An entity is an object in a game. Entities don't do anything on their own, components are attached to them to add data and logic. Entities are also hierarchical -- they can have other entities as children. This hierarchy when combined with the Sprite component, delivers the familiar Flash-like scene graph, but with the flexibility of being able to add other types of components.
Some components override each other if they have a common parent class. Adding a FillSprite to an entity for example will replace its ImageSprite. That's because they both extend Sprite. Since Sprite extends Component, anything that subclasses Sprite will share the "Sprite" namespace. Under the hood, this is implemented by giving a unique ID to each class that directly extends Component.
More details here: Flambe-core
Yes, any Sprite can be masked. It is a Rectangle and it is called a scissor:
mySprite.scissor = new Rectangle(0, 0, 100, 100); // (x,y,width,height)
Yes, but you need to process this on a new texture (using System.renderer.createTexture
). This can be heavy, but when you create this once and store the texture, it should OK in terms of performance. You could choose to dispose the original texture if you don't need that one anymore. This is a helper function for masking textures:
public static function getMaskedTexture(image:Texture, mask:Texture, destX:Float = 0, destY:Float = 0):Texture
{
var texture:Texture = System.renderer.createTexture(image.width, image.height);
var graphics = texture.graphics;
graphics.save();
graphics.drawTexture(image, 0, 0);
graphics.setBlendMode(BlendMode.Mask);
graphics.drawTexture(mask, destX, destY);
graphics.restore();
return texture;
}
In Flambe, you can create scenes (pages) very easy using a Director
and Scene
classes. See Scenes & Transitions
No. I think Stage3D performance under AIR is acceptable for most mobile games, and comes with features that aren't in NME yet (Web views, video, camera). It's possible an NME/C++ backend could be added as an option in the future, but adding a C++ backend will mean a lot of time testing and fixing native quirks. I'd rather spend that time on the HTML5 and Flash targets, and actually shipping the game I'm working on :)
Many properties in Flambe are AnimatedFloats. Using animateTo()
on an AnimatedFloat value makes it dead simple to say, spin a sprite or fade out a sound. But what if you want to do something more complicated, like chain animations together, loop them, or run code at certain times?
Sometimes you need two builds to be slightly different. The quick and dirty way
is to use the compiler preprocessor: #if flambe_air foo() #else bar() #end
will compile to foo() in AIR, and bar() in Flash and HTML5. The clean and
scalable way is to add another build line to your wscript that compiles a
different main class.
Please check out Known issues limitations or consider reporting a bug/feature request
Documentation guide for Flambe - Targeted to version 4.0+
Flambe | Installation | Demo projects | Showcase | API Reference | Forum
Flambe is MIT licensed and available for free. Feel free to contribute!
- Home / Installation
- Entity / Components
- Core
- Assets
- Publish your game
- Other
- Editors
- Plugins, tools, extensions
- Help
- More Flambe