Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying props at runtime doesn't seem to work properly #798

Closed
dominusac12 opened this issue Dec 7, 2023 · 2 comments
Closed

Modifying props at runtime doesn't seem to work properly #798

dominusac12 opened this issue Dec 7, 2023 · 2 comments
Labels

Comments

@dominusac12
Copy link

Describe the bug
I've created multiple props in the LitiUtil the render type is none and collision is false. Now I want to change the render type while playing the game.
So is used the following code:

  for (Prop prop: Game.world().environment().getProps()){
            prop.setRenderWithLayer(false);
            prop.setRenderType(RenderType.NORMAL);
        }

This didn't worked so I tried debugging it. The props will be queried right, so I think the foreach-Loop is right.
A bit clueless I tried to change other things of the props.
When I tried changing the collision this also doesn't work, but changing the x-Position worked.
I also tried using the for loop at different location like right after Loading the environment, Game.world().onLoaded, in the renderer.
But this didn't changed problem.

Maybe I'm doing something wrong but at the moment I don't know what.

Expected behavior
Rendertype and collision can be changed at runtime

Your System:

  • OS: WIN-10
  • LITIENGINE version: litiengine:0.5.2
  • Java JDK/JRE version: JDK 21.0.1
  • Screen resolution: 1920x1080
@dominusac12 dominusac12 added the bug label Dec 7, 2023
Copy link

github-actions bot commented Dec 7, 2023

Thank you for your reporting your first LITIENGINE issue! We are looking forward to your further contributions.

@nightm4re94
Copy link
Member

Setting RenderTypes at runtime indeed did not change which collection of renderables an entity was stored in, despite the entity's RenderType attribute changing successfully. I've made sure that the environment is now handling this properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants