How to Set Actor Dimensions with code

Non-platform specific questions.

How to Set Actor Dimensions with code

Postby zichemak » Wed May 01, 2013 8:11 pm

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.
zichemak
 
Posts: 10
Joined: Mon Apr 29, 2013 6:34 pm
Score: 0 Give a positive score

Re: How to Set Actor Dimensions with code

Postby skydereign » Thu May 02, 2013 3:18 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron