Can I create objects (like rectangles) with commands in Powerbuilder?

276 Views Asked by At

I'm trying to program Tetris with powerscript. Don't ask why, but I would know, if I could create random objects in powerbuilder.

1

There are 1 best solutions below

1
On BEST ANSWER

You can create these types of objects within a datawindow control. Generally this would be a series of 'Modify' statements. Here is one example from the PowerBuilder help:

string modstring

modstring = 'create rectangle(Band=background X="206" Y="6" height="69" width="1363" brush.hatch="6" brush.color="12632256" pen.style="0" pen.width="14" pen.color="268435584" background.mode="2" background.color="-1879048064" name=rect1 )'

dw_cust.Modify(modstring)

This creates a rectangle in the background of a datawindow. If you need to move the thing you would have to set up a timer and then change the x and y properties appropriately.

To create a Tetris type game in PB would be quite an achievement. I've made games with PB before but none which had the movement complexity of Tetris.