March 28, 2024, 09:51:06 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Help with HGE

Started by definitelyokay, December 02, 2009, 06:59:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

definitelyokay

I've been happily learning how to use HGE, thanks to fasecero's excellent resources.

However, I'm stumped on this particular demo program I'm making. Basically I have some pictures of some planets and I'd like to pan them around using the arrow keys.

But for some reason, it does everything but render! I think. I'm not exactly sure what's causing the problem, but you can find the complete program with it's resources in the attached zip.

I'd be much obliged if anyone can help! I'm pretty sure it's something simple I might be missing.

Joseph

fasecero

Hi, JosephE. In the Frame function you don't give an initial value to the offsets, therefore, they will have random content, so just add something like:


Int OffsetX, OffsetY
OffsetX=0 : OffsetY=0


happy coding!

definitelyokay

Having done as you said, and tweaked a few things, everything works great!

Somehow I assumed that EBasic cleared a variable out when it gave it to you, although I knew in languages like C and whatnot it would be garbage. Not sure how I came to that conclusion, but it definitely wasn't right.

Thanks so much for tracking that down! ;D I don't that I would have ever figured that one out.

LarryMc

another way to init variables that I use all the time:

Int OffsetX=0, OffsetY=0
string a$=""


Larry

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

definitelyokay

Thanks Larry. I've adopted the prefix variable declaration and immediate value assignment for my programming in EB, like you posted. :)