Realbasic/Xojo: an Isometric engine (2.5D)

Tim Seyfarth had a specific question about adding a Z-axis to a floorplan. Immidiately I was thinking about the Isometric games like Diablo and I thought it would be a nice thing to try it out in Realbasic/Xojo. However, it looked like it was not that easy to implement as it seems. A lot of math is needed to create an engine like this. As my time is limited, I decided to spend some evenings translating an existing engine into Realbasic/Xojo. I have chosen the μIso (μIsometric Engine: A Java Isometric Engine) engine. The original code can be found here. All credit for the think work goes to Luis Henrique Oliveira Rios. Visit his page for some explanation.

μIso has some flaws I noticed (sometimes a ‘strange’ hole is visible in the montains or the mouse pointer loses track) but as you have the source code you can try to figure it out for yourself.

The speed in Realbasic/Xojo is also very slow (I get 7 frames per second, while the original java code got over 30 fps), but don’t let this discourage you to take a look on how it works. I don’t see this as an engine to create games with, but rather a tool to generate static pictures (like a floorplan).

You can scroll through the demo with the cursor keys (the minotaur does not move as I did not include the pathfinding algorithm). You can move the mouse to highlight a tile.

The program consists of two main folders:
1. UISO2.5D
This contains the real engine. Except for bug fixing, you should not need to make any changes to these classes.
2. Demo
This is a demo how you use the engine. All classes here are subclasses of the engine classes.
isometric folders

The full source code can be downloaded here

Some notes about the code:
1. change the path to the sprites (SpritePath) !!!!!!!!!!!!
2. if working with PRE Xojo, download the PNGutilities plugin ( and change in LoadABImage (ABGlobal):

for RB 2007:
dim img as new ABImage(PNGu.OpenAsPictureWithMask(f))
for xojo:
dim img as new ABImage(picture.Open(f))

Have fun programming and cheers for now!


Click here to Donation if you like my work


About Alwaysbusy

My name is Alain Bailleul and I'm the Senior Software Architect/Engineer at One-Two. I like to experiment with new technologies, Computer Vision and A.I. My projects are programmed in B4X , Xojo, C#, java, HTML, CSS and JavaScript. View all posts by Alwaysbusy

7 responses to “Realbasic/Xojo: an Isometric engine (2.5D)

  • Raphaelhael

    You’ve got your redirection wrong for the download link passed.
    I guess you’ve forgott the http:// to make it happen?

    I was smart enough to figure it’s

    • Alwaysbusy

      Woops, a copy and paste error 🙂 Thanks for pointing it out Raphaelhael 🙂

      • Raphael

        You’re welcome !
        … as it looks like I even misspelled my name (oups), so human error is obviously not a myth … no need for appologies this time 😉

        Out of pure interest, I just tested it on my mac during a coffee break. Haven’t done anything with RB / Xojo for a really long time, but I had to check out the work on this one …

        Works great! Even though I also get only about 8 to 11 fps.
        But if I had more time, this would encourage me to improve this and make something out of it. Great work!
        There’ll probably be a lot of happy kids on this one 😉

        BTW, I changed the spritePath to a FolderItem. Default is selectFolder(). Then in init just the usual FolderItem.child(“filename”).AbsolutePath … thought it was easier and more dynamic …

        • Alwaysbusy

          I thought something was wrong with your name but maybe it was an alias you used and Raphael was already taken so you doubled the hael 🙂

          Yes, speed is an issue in the xojo version, but I do not have the time either to optimize it. I don’t have an immidiate need for this and people got the source. I hope someone who does optimize it sends me his version, but I fear not a lot of my readers share their code back to me.


          • Raphael

            I haven’t done it yet and don’t know how common it is in the Xojo community, but if you’d use Git you could maybe at least keep stats and eventually / possibly track changes?

            I don’t have time either, but someday I’ll continue my path on Xojo and for that I’m glad I found your canvas tutorials !

            Anyhow. Thanks for the nice demo and have a great day! 🙂

  • Max

    Very good Alain. I will study it in deep

  • Tim

    Hello Alain,
    Thank you for doing this! I apologize for the delay in reviewing – it was unfortunate and unavoidable. I plan to have a look this evening – but from your article here and the responses, sure looks good!
    Thank you again,
    Tim Seyfarth

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: