You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When spawning objects in the either the right or bottom edges of the ui (meaning using either getAppWidth or getAppHieght) the objects are placed either slightly away from the edge in case of the right or be slightly below the window in case of the bottom.
This was tested with the official pong tutorial app( see included images), as well as personal apps ( see included code).
To Reproduce you can do one of the following:
Run the pong example
Use the following code( if needed i have other examples with the same results):
` @spawns("border")
public Entity createBorder(SpawnData data){
Path path = new Path();
path.setStroke(Color.RED);
path.setStrokeWidth(TILE_SIZE); // In my code 30 but could be any value
ObservableList<PathElement> elements = path.getElements();
// Sets Start point
elements.add(new MoveTo(0,0));
// Creates border lines
HLineTo top = new HLineTo(getAppWidth()-(TILE_SIZE/2));
VLineTo right = new VLineTo(getAppHeight()-(TILE_SIZE/2));
HLineTo bottom = new HLineTo(0);
VLineTo left = new VLineTo(0);
// Actually adds the lines
elements.add(top);
elements.add(right);
elements.add(bottom);
elements.add(left);
return entityBuilder(data)
.type(EntityType.BRICK)
.viewWithBBox(path)
.collidable()
.zIndex(-1)
.build();
}
`
See the right paddle's margin compared to the left
Ubuntu 20.04.2 LTS 64-bit
The text was updated successfully, but these errors were encountered:
Thanks for this. I suspect this is an issue related to window handling on Linux as I recall similar problems in the past. I will see if I can reproduce this in a pure JavaFX app, in which case that will suggest the issue comes from JavaFX, rather than FXGL.
When spawning objects in the either the right or bottom edges of the ui (meaning using either getAppWidth or getAppHieght) the objects are placed either slightly away from the edge in case of the right or be slightly below the window in case of the bottom.
This was tested with the official pong tutorial app( see included images), as well as personal apps ( see included code).
To Reproduce you can do one of the following:
`
@spawns("border")
public Entity createBorder(SpawnData data){
`
See the right paddle's margin compared to the left
Ubuntu 20.04.2 LTS 64-bit
The text was updated successfully, but these errors were encountered: