Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Code for isometric block

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 29th May 2017 14:55
Hi

I have tried this code to add isometric block.
It works fine, but in some cases, the block isn't added at the position of the mouse.

Do you know how I can fixe that ?




Image :
http://blendman.free.fr/dev/agk/block.png


AGK2 tier1 - http://www.dracaena-studio.com

Attachments

Login to view attachments
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 29th May 2017 22:36 Edited at: 29th May 2017 22:43
Hi Blendman,

try this. I changed tx and ty to floats and offset the pointer coordinates by half of your sprite's width/height.



-h
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 30th May 2017 07:47 Edited at: 30th May 2017 10:59
Hi

Thank you very much Hendron !

It's much better.

AGK2 tier1 - http://www.dracaena-studio.com
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th May 2017 22:46
If you search for isometric or Tiled (or tmx), you'll find some posts of mine that you may find useful if you're planning an isometric engine.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-03-29 06:45:57
Your offset time is: 2024-03-29 06:45:57