Giter Club home page Giter Club logo

Comments (4)

fgnm avatar fgnm commented on May 22, 2024

You can wrap whatever you want into a composite and save it as a library item. Then, you can export it as h2dlib format (it's a zip that contains all required resources) and import in any other project.

https://github.com/rednblackgames/HyperLap2D/wiki/Import-Export-Library-items

There might be some issues with projects that have different PPWU, should be tested a bit more :)

from hyperlap2d.

aallnneess avatar aallnneess commented on May 22, 2024

Hm. Okay, with Itemwarpper i can get the sprite ingame and animate it well.
But, physics i must add to composite to make it work. But, composite is ingame no enitiy ?

image

(when i only add physics to the sprite inside the composite - nothing happends ingame. so i thing i must take action the x/y pos. from the composite....but when i want to work with box2d - and the composite is no entity.... ? :D )

Edit:

Hm, should be no problem.... 🤔 i will try

Edit 2:

Nope: No entity, no components, no x/y settings....

from hyperlap2d.

fgnm avatar fgnm commented on May 22, 2024

Composite are entities too, root for example is a composite, also if look at demo project level-3-skull is a composite and you can get entity from it. Is the project exporting correctly?

Regarding box2d bodies inside composites isn't possible, becuase objects chenge their coordinates inside, so box2d cannot work properly

from hyperlap2d.

aallnneess avatar aallnneess commented on May 22, 2024

yeah, i was to fast with writing here, it works:

    // test Composite entity to take action to box2d etc.
    Entity testComp = root.getChild("testComp").getEntity();

    // test ItemWrapper to become the child sprite animation
    ItemWrapper testItem = root.getChild("testComp");

    // init testSprite Entity from composite
    Entity testSprite = testItem.getChild("testSprite").getEntity();

from hyperlap2d.

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.