Giter Club home page Giter Club logo

Comments (9)

niom avatar niom commented on July 22, 2024

I would like to support this idea. Multi layer feature is needed for handling HUD with Camera.

from rapanui.

niom avatar niom commented on July 22, 2024

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

  1. 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()
  1. 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
  1. 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.

niom avatar niom commented on July 22, 2024

I'm working with an implementation for this. It's going to take at least few days so stay tuned.

from rapanui.

eljeko avatar eljeko commented on July 22, 2024

Great, remember to submit patch on dev branch,

thank you for your help!

from rapanui.

skaflux avatar skaflux commented on July 22, 2024

This will be great! I'm currently stuck on something because I want to have separate layers. Thanks!

from rapanui.

niom avatar niom commented on July 22, 2024

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.

MattiaFortunati avatar MattiaFortunati commented on July 22, 2024

Hey guys,

I've merged, reviewed and extended the multilayer feature.

5a4896c

Thanks for all your efforts!

from rapanui.

skaflux avatar skaflux commented on July 22, 2024

@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.

 avatar commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.