|
Author |
Topic: Centering an object (Read 875 times) |
|
Nekochan =^.^=
|
Centering an object
« on: Sep 6th, 2003, 2:38am » |
|
I know there's a formula or something for this, but how does one center a picture in the space? You know, so the middle of the picture is in the middle of the applet?
|
oto no nai mahiru kaze ha tada akarui sukoshi nemutasou ni hanabira ga yureta nani ge nai kono omoi nee, hito ha donna kotoba de yondeiru no
|
|
|
Bijeoma
|
Re: Centering an object
« Reply #1 on: Sep 6th, 2003, 4:34am » |
|
size(200, 200); BImage a; a = loadImage("myImage.jpg"); image(a, width/2-a.width/2, height/2-a.height/2); i think that should work w/ all sized images... i havent tested it. bryan
|
|
|
|
Nekochan =^.^=
|
Re: Centering an object
« Reply #2 on: Sep 6th, 2003, 7:20pm » |
|
It works great. Thanks a lot. Now I just eed to resize the images (don't worry, I know how to do that) and it'll be all set. Awesome!
|
oto no nai mahiru kaze ha tada akarui sukoshi nemutasou ni hanabira ga yureta nani ge nai kono omoi nee, hito ha donna kotoba de yondeiru no
|
|
|
|