Moving IgeEntity responsively to the client viewport

Post your help queries and engine programming questions here

Moving IgeEntity responsively to the client viewport

Postby lucbr » Fri Oct 25, 2013 6:14 pm

Hi!

I would like to move one IgeEntity from the left-side of the client screen to its right-side, and vice versa. However, I need to take into account that the client screen can be different.

One behavior like that could be achieved by using the left or right attribute from IgeUiEntity. However, I would like to know how to do that by using my custom class extended from IgeEntity.

I really need to know the client viewport on my server-side to translate my IgeEntity properly.

Thank you!! :)
lucbr
 
Posts: 27
Joined: Fri Oct 25, 2013 3:26 am

Re: Moving IgeEntity responsively to the client viewport

Postby rob » Sat Oct 26, 2013 12:18 am

Is there only going to be one client connected? If not then I don't know how the server could move the object for each different client's screen size...

Are you sure that you want to do it that way anyway? The server doesn't (and shouldn't) know anything about the rendering details on the client. It is up to the client to scale the simulation to fit the screen.

If you are looking to have the same "bounds" on each client so that regardless of the screen resolution you always have 800 world pixels from left to right then you can just calculate the correct scale ratio and scale the viewport camera so that all clients see the same view, just some will see it "bigger" if their resolution is high.

Hope that makes sense!
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm

Re: Moving IgeEntity responsively to the client viewport

Postby lucbr » Sat Oct 26, 2013 12:23 am

yeah, it makes sense :) Thanks!
lucbr
 
Posts: 27
Joined: Fri Oct 25, 2013 3:26 am


Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest
cron