Comments (9)
I would like to support this idea. Multi layer feature is needed for handling HUD with Camera.
from rapanui.
I've been trying to solve how we could make RapaNui multilayered and have found at least three cases which would be affected by the multilayer feature and we probably need a new RN class to handle the layers.
RNLayer
- this class should handle layer creation, storing and removing layers
- we should have way to create a layer with and without MOAIPartition
-- createLayer
-- createLayerWithPartition
RN parts affected by multilayer
- Initializing screen
- When initializing screen we should create the main layer as before
- Main layer should be stored to RNLayer (new RN class)
these could be done by using the new RNLayer.createLayerWithPartition()
- Creating a new RNObject from image
- we should be able to pass the layer to the image creation and if the layer is missing we should use the main layer
- new MOAIProp is added to the layer in RNObject:initWithImage2, so we should be able to pass the layer in that function. Fortunately initWithImage2 takes only one parameter, the image, in so this should be easy.
- To support backwards compatibility we should use a new function for createImage, ie. createFromImage(image,layer,parameters) and make the createImage to use createFromImage with main layer
- Removing RNObject from layer
- RNScreen:removeRNObject(object) should be able to take the layer as a parameter so the removed object would be removed from that layer.
- in case the layer parameter is not passed then we should remove the object from all of the layers, by using the RNLayer class
Should we consider any other parts which would be affected by the multilayer feature or could this be the minimun viable feature considering the multilayer?
from rapanui.
I'm working with an implementation for this. It's going to take at least few days so stay tuned.
from rapanui.
Great, remember to submit patch on dev branch,
thank you for your help!
from rapanui.
This will be great! I'm currently stuck on something because I want to have separate layers. Thanks!
from rapanui.
Sorry we only made one sample for the multilayer. How to create a HUD with another layer and how that behaves with camera and camera movement. @skaflux did you have some other idea where to use the multilayer? Maybe you could provide a sample from your requirements?
from rapanui.
Hey guys,
I've merged, reviewed and extended the multilayer feature.
Thanks for all your efforts!
from rapanui.
@niom What I'm trying to do is to give the appearance of depth in the 2D world. Lets say 4 layers. Layer 1 is the background image. Layer 2 has background objects flying around. Layer 3 is the game layer where collisions are happening. Layer 4 has the GUI elements. Does this make any sense?
Thanks!
from rapanui.
I'm attempting to take a layer from a map loaded through RNMapFactory, insert the player into the layer, and apply one of Moai's prebuilt sorts [ layer:setSortMode ( MOAILayer2D.SORT_VECTOR_ASCENDING ) ]
The trouble is the only time RN seems to expose itself to MOAILayer is in RNLayer, but RNMapLayer is unconnected to RNLayer. Should I even be approaching the problem from this angle?
from rapanui.
Related Issues (20)
- Slow monitor in Rapa Nui
- Issue RNGraphicsManager:deallocateGfx bramch rapanuidev HOT 4
- Manipulating tiles
- How to create List horizontal ?
- How to set center location rotate and scale?
- how to show dialog in rapanui ??? HOT 3
- Wrap MOAI's native dialogs HOT 1
- MOAITextBox.LEFT_JUSTIFY v MOAITextBox.RIGHT_JUSTIFY (Y position problem) HOT 2
- Issue Object events disabled when set Object in hudLayer
- Free Box2D Platformer Game Code HOT 1
- how to use applyLinearImpulse ??? HOT 3
- connect two physics objects HOT 2
- Multithreading ! HOT 2
- collision remove HOT 1
- createanim with createAtlasFromTexturePacker HOT 1
- RNFactory.init() gets non existing MOAIEnvironment members HOT 1
- RNObject.tileDeck never given a value
- RNInputManager uses wrong coordinates HOT 1
- categoryBits , maskBits and groupIndex in rapanui HOT 4
- What happened to the web site?
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 rapanui.