narfman0 / GDXWorld

2D world editor for libGDX. Has an overhead map/level layout designer, which may drill into a level and intelligently place physics bodies, enemies and pathing, and other objects.
Other
36 stars 10 forks source link

Augment scissors #25

Closed narfman0 closed 10 years ago

narfman0 commented 10 years ago

Scissors in gdxworld are used with backgrounds to clip their extents. For instance, in a jungle level, I want a rainforest background to look very far away at depth=10. However, I also want to quickly transition from this to a waterfall distance=20. I can't have the rainforest and the waterfall background simultaneously, as the distance=10 would move very slowly, so I would put some sort of mountain or other stuff at distance 1-2, then scissor behind that to make it look like a quick transition.

  1. When executing the above example, sometimes the rainforest background won't show up, or show up inconsistently/flicker. Need to make everything show up if it is not using scissors. A way to sidestep this is using scissors and turning up the values extremely high, but this is lame.
  2. The UI for ScissorStack is not super helpful. The UI SHOULD be able to say bottom left and top right to define an AABB in which the background will always draw, regardless of zoom level. ScissorStack should work, but probably some dumb math issue somewhere. Right now again one must use very high values for width/height. I believe center works, however.
narfman0 commented 10 years ago

Relevant code: GDXBackground:87-105 BackgroundWindow:45-65 GDXRenderer:95-107

narfman0 commented 10 years ago

Finished with merge 18770707ba93c9a7eb4997e9a05f2f4e75fd8dba