How come this doesn't work?
Blitz3D Forums/Blitz3D Beginners Area/How come this doesn't work?
| ||
Global radydistance=(ScreenY# * (578/768)) Where ScreenY# = 768 For some reason it's not returning anything Any thoughts? |
| ||
Just understood what you're trying to do... It's a float / int thing Without testing try doing screeny# * (578.0/768.0) |
| ||
Hi there. Try this: Graphics 640,480,32,2 yScreen=768 Global radydistance=(yScreen * (578.0/768)) Print radydistance WaitKey() Your calculation was returning 0 because you were trying to do float division with integers. Someone else can probably explain this better than me, but if you are calculating a float, you need to use floats in your division. Which is why the code above has 578.0 instead of 578. [EDIT] Rob - your post appeared literally 8 seconds before mine. |
| ||
Thanks a lot!! It makes complete sense. |