instantreality forum
news: Welcome to the instantreality forums!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 17, 2018, 02:31:02 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Resizing a Rectangle2d doesn't work.  (Read 2506 times)
privateRob
Newbie
*
Posts: 8


View Profile
« on: June 28, 2011, 08:52:18 pm »

Hi!

Resizing a Rectangle2d doesn't work in my example and I have no clue why. To show my problem more precisely, I c&p some code of my project:


Code:
// This doesn't work
shape.geometry.size = new SFVec2f(100, 0.5);

But if I reset the geometry at all, like in the following code, it works:
Code:
// but this does
var rectangle2d = new SFNode("Rectangle2D");
rectangle2d.size = new SFVec2f(100, 0.5);
shape.geometry = rectangle2d;

What's wrong or missing?
Logged
yjung
Administrator
Sr. Member
*****
Posts: 260


View Profile
« Reply #1 on: June 29, 2011, 11:50:41 am »

Hi,

size is a initializeOnly field, which means that it can only be set during init for allowing performance optimizations. For rescaling an existing object you need to use a Transform node.

Bye
Yvonne
Logged
privateRob
Newbie
*
Posts: 8


View Profile
« Reply #2 on: July 01, 2011, 05:45:36 pm »

Hi,

size is a initializeOnly field, which means that it can only be set during init for allowing performance optimizations. For rescaling an existing object you need to use a Transform node.

Bye
Yvonne

Okay, this makes sense!
Thank you
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2011, Simple Machines