Re: Floor Perspective

59 views
Skip to first unread message

Sergey Mukhin

unread,
May 20, 2013, 2:49:58 AM5/20/13
to pl...@googlegroups.com
you should use a few SurfaceLayer's on background, ImmediateLayer for character rendering.
to move over a background change (x,y) coordinates and use layer.setOrigin(x, y); method to change SurfaceLayer position.

Also you should think about background repeating so draw 4 backgrounds and to switch between it use a % operator (modulus)
layer.setOrigin(x % (layer.width()/2), y % (layer.height()/2));


Carlo Innamorati

unread,
May 20, 2013, 1:38:05 PM5/20/13
to pl...@googlegroups.com
The problem is that the background isn't "repeatable" because it is a pretty complex image (and for other reasons as well), so I actually need some kind of function that allows me to stretch the image and give it a sense of perspective.

I found a perspective filter on this page http://www.jhlabs.com/ip/filters/index.html (source code here: http://www.jhlabs.com/ip/filters/Filters.zip) but I have no idea on how to implement it on PlayN...

Sergey Mukhin

unread,
May 21, 2013, 3:48:00 AM5/21/13
to pl...@googlegroups.com
check ShaderTest from here:

it has some kind of image perspective you need.
Reply all
Reply to author
Forward
0 new messages