program HowToModelShapeUsingRecord; uses SwinGame; procedure Main(); var c : Circle; r : Rectangle; t : Triangle; l : LineSegment; begin OpenGraphicsWindow('Model Shape Using Record' ,600 ,100 ); LoadDefaultColors(); ClearScreen(ColorWhite ); c := CircleAt(50 ,50 ,30 ); r := RectangleFrom(300 ,20 ,100 ,60 ); t := TriangleFrom(450 ,80 ,550 ,80 ,500 ,20 ); l := LineFrom(100 ,40 ,250 ,40 ); DrawCircle(ColorBlue ,c ); DrawRectangle(ColorGreen ,r ); DrawTriangle(ColorPink ,t ); DrawLine(ColorRed ,l ); RefreshScreen(); Delay(5000 ); ReleaseAllResources(); end; begin Main(); end.
How To Model Shape Using Record
This article will show you how to draw shape using record in SwinGame
SwinGame allows you to use different record for various shape types such as Circle, Rectangle, Triangle, LineSegment. To use these record you need to:
- Make sure your code is opening SwinGame's graphic windows
- Clear the screen
- Call appropriate shape function to initialize your record. Function such as CircleAt, RectangleFrom etc ....
- Call draw "insert shape name" procedure and passing the record as parameter to draw a shape
- Refresh the screen
- Released all resources
- Run the program
Under Read These First is a screenshot showing what the program look like and below is the code for it.
Suggested projects will appear here.