Example 15.1-isoimages help

Post your help queries and engine programming questions here

Example 15.1-isoimages help

Postby Tananez » Sun Mar 01, 2015 1:33 pm

Hi!
I plan to buy this engine because i never seen one like this , much more the ui and depth its fantastic .
Right now i have no money , and im very poor , i live in Romania , i earn 140 euro / month , with this ammound can barely live , and the products cost like rest of europe and some of them mby even more.

I want to build a litle game , make some money to get this full source with last updates , to further develop .
Right now i still learn how it works , i learn fast .

I have found this Example 15.1-isoimages , i post an image.

My Problem is that i dont know to make 2 things.
1. The space outside the grid to be ocupied so no other buildings cant be build in that area or to be moved. (i have paint with blue)
2. The map to be limited in width and height , lets say 2000px X 1700px (when its dragged to not move more then the limit width and height)


I realy need this please help me .





Image
Tananez
 
Posts: 3
Joined: Tue Feb 17, 2015 8:16 am

Re: Example 15.1-isoimages help

Postby robaldred » Mon Mar 02, 2015 3:29 pm

Hey welcome,
No worries the engine is free to use for non-commerical use. Just so you know if you are selling access to the game or other in-game purchases you must buy a licence for the engine.

To answer your questions, you can achieve what you're after with a little coding.


1.
I'm going to assume you have a method which is handling the mouse click and placement of objects.
In that method you could do a simple check to ensure the click tile is within the grid.
Code: Select all
if(selectedtile.x < 0 || selectedtile.y < 0 || selectedtile.x > tileMap.gridSize().x || selectedtile.y > tileMap.gridSize().y) {
   // this tile is outside the grid
   // don't place/move object
} else {
  // inside the grid
  // do the work here to place/move the object
}


2.
You can use the limit() method on your viewport mousepan component to stop the camera from moving beyond that limit.
This limit method takes a single argument of an IgeRect
Something like....

Code: Select all
    limit = new IgeRect(0, 0, tileMap.width(), tileMap.height());
    viewport.mousePan.limit(limit);
I don't work for Irrelon. All comments are my own.
I would strongly encourage anyone building production projects with Isogenic to buy a premium licence, it costs very little and will help towards continued development of the engine. Irrelon have spent thousands of hours developing this wonderful platform with many features found in AAA game engine.
User avatar
robaldred
 
Posts: 243
Joined: Wed Oct 23, 2013 8:09 pm
Location: Manchester, England


Return to Help & Questions

Who is online

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