mojo.graphics Module Image.Width

Community Forums/Monkey Talk/mojo.graphics Module Image.Width

MoonShadow(Posted 2011) [#1]
Can anyone make an example of how to use Method Width(). Im trying to make a collision function. If can't find a way to use Image Width, I guess I will creat the function using the "distance formula" wich Im trying to avoid. Any ideas? I want to test it before I buy it.


Matty(Posted 2011) [#2]
Local image:Image
image = LoadImage("myimage.png")
Local width:float
width = image.Width()

???

What else do you need ???


MoonShadow(Posted 2011) [#3]
Thanks Matty for replying. Well I didn't express myself well, what i was trying to say, how exactly you get your image width value. For example in B3D is [ valueImage= ImageWidth(image) ], now I could use valueImage to make a collision function. Im new at this framework. :oS


Matty(Posted 2011) [#4]
In that case the method I've shown above will do that:

in the above example:

Local myimage:Image 'image is an object of type "Image"
myimage = LoadImage("mypictureimage.png") 'myimage now holds a reference to the image "mypictureimage.png"
Local mywidth:float 'mywidth is a local variable of type float
mywidth = myimage.Width() 'we assign the variable the value of the image's width using the Width() method



Hope that is a little clearer.

Last edited 2011


MoonShadow(Posted 2011) [#5]
Thank you very much Matty


MoonShadow(Posted 2011) [#6]
I got confused with width = image.Width() i was thinking image was part of the width() method. Thank you Matty!