Skip to main content

Determining the inner width of the Stage

1 reply [Last post]
dutchiedave
Offline
Joined: 2004-05-12

Hi all,

I am trying to bind the width of my custom node to the inner width of the stage. I can bind it to the stage width but i need the stage width minus the thickness of the frame border.

Any pointers would be greatly appreciated,

Dave.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12

Bind them to the Scene width and height:

[code]
var scene:Scene = Scene {
width: 200
height: 200
content: [
Rectangle {
width: bind scene.width - 1
height: bind scene.height - 1
fill: Color.WHITE
stroke: Color.GREEN
strokeWidth: 4
}
]
}

Stage {
title: "MyApp"
scene: scene
}
[/code]