A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 9 Ω


Basic256 Stamp


Programmieren


Basiswissen


In der Programmiersprache Basic256 zeichnet und verändert der Befehl Stamp Vielecke. Dazu hier ein Beispiel.

Syntax


stamp x, y, Feldvariable
stamp x, y, {x1, y1, x2, y2, x3, y3 ...}
stamp x, y, Skalierung, Feldbariable
stamp x, y, Skalierung, {x1, y1, x2, y2, x3, y3 ...}
stamp x, y, Skalierung, Drehung, Feldvariable
stamp x, y, Skalierung, Drehung, {x1, y1, x2, y2, x3, y3 ...}

Erklärung


x = x-Wert der linken oberen Ecke
y = y-Wert der linken oberen Ecken
Skalierung = Vergrößerungsfaktor
Drehung = Drehwinkel in Rad und im Uhrzeigersinn

Das erste x-y-Paar legt sozusagen einen selbstgewählten Koordinatenursprung fest. Die x- und y-Werte der Eckpunkte gelten dann alle relativ zu diesem selbstgewählten Koordinatenursprung.

Beispiel I


clg
color blue
rect 0,0,300,300
color green
dim tri(6)
tri = {0, 0, 100, 100, 0, 100}
# stamp the triangle at 0,0 (full size)
stamp 100, 100, tri
# stamp the triangle at 200,100 (half size)
stamp 200, 100, .5, tri

Beispiel II


clg
color blue
rect 0,0,300,300
color green
# stamp the triangle at 0,0 (full size)
stamp 100, 100, {0, 0, 100, 100, 0, 100}
# stamp the triangle at 200,100 (half size)
stamp 200, 100, .5, {0, 0, 100, 100, 0, 100}