Next Series of Updates (Performance tweeks)

Yeah i watched to the repo and see the change of the control constructors and my compiler has an error with my overloaded button constructors. After i changed my constructors to the ElementManger its works.

1 Like
@Snowsun92 said: Yeah i watched to the repo and see the change of the control constructors and my compiler has an error with my overloaded button constructors. After i changed my constructors to the ElementManger its works.

As much of a pita as I know this can be… I decided to make the change in this fashion to ensure that custom controls could be used with the SubScreen class without having everyone go through backflips to make it happen.

Between this an the xml extension name change, I am hoping these are the last code-effecting changes I’ll ever implement. I’ve been trying to keep this at the forefront of the whole effort, as I know how frustrating it can be when this happens.

I think changes on constructors and other things are normal when a project is under development.

1 Like
@t0neg0d said: Try casting screen to Screen and this should fix the issue... however, not sure why this would happen.

Wait, screen is already screen?

screen = new Screen(app, “tonegod/gui/style/def/style_map.xml”);

Can’t quite get it yet working.

java.lang.NullPointerException at tonegod.gui.controls.buttons.Button.<init>(Button.java:111) at mygame.gui.components.ActionButton.<init>(ActionButton.java:21) at mygame.gui.StartScreen.<init>(StartScreen.java:39) at mygame.gui.GameScreen.<init>(GameScreen.java:55)

Line 111 of button:
public Button(ElementManager screen, String UID, Vector2f position) {
this(screen, UID, position,
screen.getStyle(“Button”).getVector2f(“defaultSize”),
screen.getStyle(“Button”).getVector4f(“resizeBorders”),
screen.getStyle(“Button”).getString(“defaultImg”)
);
}

@avpeacock said: Wait, screen is already screen?

screen = new Screen(app, “tonegod/gui/style/def/style_map.xml”);

Can’t quite get it yet working.

The extensions for all xml files have changed to .gui.xml Change the above line to:

[java]
screen = new Screen(app, “tonegod/gui/style/def/style_map.gui.xml”);
[/java]

This reminds me… the new xml loader is silently failing instead of throwing an exception. I need to fix this, as it causes errors to be thrown in places that are not related to the problem… Sorry about this!

1 Like

@avpeacock
The other option is to just initialize the screen without the pointer to the xml file, since you are using the default non-atlas style def.

screen = new screen(app);

@t0neg0d said: Sorry... following now. You're using this with a ScrollArea. Are you using ScrollArea or ScrollAreaAdapter? The first was really built for internal use and is not *overly* user friendly ;)

Ah okay i used ScrollArea… ^^ I will try my stuff with the adapter