LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Game Problems

Hello kstrauch,

 

I'm not really sure what you mean by flattened vs. unflattened images, and it's also not clear what functions you're attempting to use to display or modify the images in question.  Could you post your code or a portion of it with a sample image and the portion you're stuck on pointed out?

 

Regards,

Tom L.
0 Kudos
Message 11 of 13
(351 Views)

Thanks for the help Tom, I'm sorry I wasn't clear. I've attached my code, however, I still cannot figure out how to make the paths work after I move the folder. The two images are drawn, and I need to move my spaceship around when keys are pressed. I know how to move it, I just cannot find the location cluster for the ship drawing, if it even exists. The ship when drawn unflattened loses its transparency, and also does not look the same. When drawn flattened, it has transparency and looks correct, but there is no terminal for location. The goal is to be able to move the ship png file around in the picture box, while retaining the transparency. If you need the code in a different version of LabVIEW, I can change it for you.

 

Thanks,

Kevin

Download All
0 Kudos
Message 12 of 13
(338 Views)

Hi kstrauch,

 

I've not yet had a chance to take a look at your code, but based on your post it sounds like there might be a better approach to what you're doing - rather than trying to track the ship's position "in the picture", track it separately and redraw a fresh image (with the default background) each time you need to move the ship. 

 

One big thing here is that once you add things to a picture, they're not typically treated as layers (separate objects) unless you're using the IMAQ overlay functions.  Because of that, the result of adding an image to another image is a single merged image- there isn't a separate "background" and "ship drawing", so you lose that location information.

 

If you want to do a more object-oriented approach to managing things in the game (where you have control over each object and the backdrop separately), I'd recommend the 2D-in-3D method, there's a pretty good example that seems similar to what you're trying to do here:

 

Community Example: 3D space explorer game

https://decibel.ni.com/content/docs/DOC-3372

 

That might be overkill, but the option's there!

Tom L.
0 Kudos
Message 13 of 13
(319 Views)