Page 1 of 1

How to Set Actor Dimensions with code

PostPosted: Wed May 01, 2013 8:11 pm
by zichemak
Iv noticed that the physical dimensions of an actor is according to the actors image file size, ie if I have an actor with an image 250x250px assigned to it, that will become the size of the actor.

Is there any way to manipulate this through the Script editor so that the actor is displayed as 100x100px regardless of the image size assigned to it while the overflowing part of the image is cropped out?

I tried something like:

actor1.width = 100;
actor1.height = 100;

But this didn't do anything.

Re: How to Set Actor Dimensions with code

PostPosted: Thu May 02, 2013 3:18 am
by skydereign
You can't set the width and height variables. Instead you can create your own width/height equivalent actor variables using the variable gui in script. That way you set it equal to whatever you want. This won't cause the actor to scale though, as scaling isn't supported in the current version of gE.