Comments (6)
What you could do is have a Camera component that centers the parent sprite onto the character in its onUpdate. I'm working on a platformer game and doing something similar.
from flambe.
ok,and one more question.how about multiple camera ? such like http://flixel.org/features.html#cameras
and hope flambe will get these feature in coming version..
from flambe.
Oh, I see. flambe.platform.DrawVisitor should be moved to the public API to make this possible. I'm planning to do this anyways for issue #11 :)
from flambe.
I'm going to mark this as closed, as it's now trivial for users to implement cameras by using Sprite.render() and scissor rectangles.
from flambe.
any demo or democode for these feature?
from flambe.
I'm pretty sure all you want is something like this (untested):
class ViewSprite extends Sprite
{
public function new (view :Entity)
{
_view = view;
}
override public function draw (g :Graphics)
{
Sprite.render(_view, g);
}
private var _view :Entity;
}
Then you can create multiple ViewSprites that share the same view, and you can position and scissor them individually.
from flambe.
Related Issues (20)
- Low Quality on Chrome - Android HOT 1
- @:componentBase to extended components HOT 3
- Cache problem / Type name Math is redefined from module Math HOT 1
- Haxe 3.2 has been released. Current haxelib code is broken.
- html5 color / masking bug HOT 1
- template project wont build html HOT 2
- Windows 10 - Development server not found HOT 1
- AnimatedFloat.watch() doesn't work as expected
- Asset reloading incorrect after refresh in browser
- Stage3DTextureRoot.readPixels wrong ARGB to RGBA conversion
- Android build fails with debug flag
- Scroll listener not working under chrome due to a browser bug HOT 2
- Signal priority HOT 3
- Has progress stopped? Should we migrate to another framework? HOT 26
- I found an issue with bitmap fonts and Font.hx
- Not Building HOT 1
- Screen not drawing while loading asset pack in android
- A black rectangle in HTML5 & Chrome HOT 2
- Playback.dispose() Does Not Stop Playback in Cocoon for iOS
- Is this dead ? or Alive ? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flambe.