Rem example 1 from wiki
Screen 12
PX = 320: PY = 240 'center position
_MouseMove PX, PY ' set center of screen, pointer of mouse and center of circle at the same position
Do: _Limit 200
Do While _MouseInput
PX = PX + _MouseMovementX
PY = PY + _MouseMovementY
Loop
Cls
Circle (PX, PY), 10, 10
Locate 1, 1: Print PX, PY
Loop Until InKey$ = Chr$(27) 'escape key exit
as you can see my adds are:
- the 2 REM lines
- and the _MouseMove PX,PY line of code.
The issue, that I am not able to correct, comes out if you play moving the pointer of mouse some times along the horizonthal and vertical axis of the screen.
Can someone give me a feedback or an enlightment about this?
Tile = 1: FOR Z = 1 TO 6: FOR Y = 1 TO 6: TileShape(Tile) = Z: TileColor(Tile) = Y: Tile = Tile + 1: ShapeGroupOk(Z, Y) = 1: ColorGroupOk(Z, Y) = 1: NEXT: NEXT
PlayerGoal$(1) = "Group Same Shape ": PlayerGoal$(2) = "Group Same Color "
FOR Z = 1 TO 36: TilePlaced(Z) = 0: TileRemoved(Z) = 0: NEXT
' Mix Up Supply Tiles
FOR Z = 1 TO 6
FOR Y = 1 TO 6
GetTile: Tile = INT(RND * 36) + 1: IF TilePlaced(Tile) GOTO GetTile
TileShape(Tile) = Z: TileColor(Tile) = Y: TilePlaced(Tile) = 1
NEXT
NEXT
FOR Z = 1 TO 36: TilePlaced(Z) = 0: NEXT
' Get 6 Random Display Tiles
FOR Z = 1 TO 6
RandomTile: Tile = INT(RND * 36) + 1: IF TilePlaced(Tile) GOTO RandomTile
DisplayTile(Z) = Tile: TilePlaced(Tile) = 1: TileRemoved(Tile) = 1
NEXT
' Draw Board
LINE (0, 0)-(751, 751), 7, BF: LINE (10, 10)-(741, 741), 15, BF
X = 75
FOR Z = 1 TO 6
V = 75
FOR Y = 1 TO 6
LINE (V - 53, X - 53)-(V + 53, X + 53), 7, BF
BoardX(Z, Y) = V: BoardY(Z, Y) = X
V = V + 120
NEXT
X = X + 120
NEXT
' Draw Game Title
font& = _LOADFONT(fontpath$, 40): _FONT font&
COLOR 0, 11: _PRINTSTRING (912, 10), "A Q U A L I N"
' Draw Display Tiles
Position = 1: X = 420
FOR Z = 1 TO 2
V = 887
FOR Y = 1 TO 3
IF DisplayTile(Position) > 0 THEN
DrawTile V, X, TileShape(DisplayTile(Position)), TileColor(DisplayTile(Position)), 1
DisplayX(Position) = V: DisplayY(Position) = X: Position = Position + 1: V = V + 140
END IF
NEXT
X = X + 140
NEXT
StartGame:
' Displau Player Info
font& = _LOADFONT(fontpath$, 30): _FONT font&
COLOR 0, 11: _PRINTSTRING (813, 100), "Player " + STR$(Player) + " - " + PlayerGoal$(Player)
IF FirstMove = 0 AND Slide = 0 THEN
_PRINTSTRING (823, 680), " Choose a Tile to Slide or "
ELSE
_PRINTSTRING (823, 680), STRING$(100, 32)
END IF
_PRINTSTRING (823, 718), "Choose a Tile to Place on the Board"
GetTileInput:
DO WHILE _MOUSEINPUT
' Choose a Board Tile to Move
IF FirstMove = 0 AND Slide = 0 THEN
FOR Z = 1 TO 6
FOR Y = 1 TO 6
IF _MOUSEX > BoardX(Z, Y) - 57 AND _MOUSEX < BoardX(Z, Y) + 57 AND _MOUSEY > BoardY(Z, Y) - 57 AND _MOUSEY < BoardY(Z, Y) + 57 THEN Selected = 1 ELSE Selected = 0
IF _MOUSEBUTTON(1) = -1 AND Selected = 1 AND BoardTile(Z, Y) > 0 THEN
GOSUB ReleaseButton: Row = Z: Column = Y: Tile = BoardTile(Z, Y)
IF GetPlayables(Z, Y) = 1 THEN DrawCursor BoardX(Z, Y), BoardY(Z, Y), 0: GOTO SlideTile ELSE GOTO GetTileInput
END IF
NEXT
NEXT
END IF
' Choose a Tile to Place
FOR Z = 1 TO 6
IF _MOUSEX > DisplayX(Z) - 57 AND _MOUSEX < DisplayX(Z) + 57 AND _MOUSEY > DisplayY(Z) - 57 AND _MOUSEY < DisplayY(Z) + 57 THEN Selected = 1 ELSE Selected = 0
IF _MOUSEBUTTON(1) = -1 AND Selected = 1 AND DisplayTile(Z) > 0 THEN
GOSUB ReleaseButton: Tile = DisplayTile(Z): Position = Z: DrawCursor DisplayX(Z), DisplayY(Z), 0: GOTO TileChosen
END IF
NEXT
LOOP
A$ = INKEY$: IF A$ <> "" THEN IF ASC(A$) = 27 AND FullScreen = 0 THEN FullScreen = -1: _FULLSCREEN _SQUAREPIXELS , _SMOOTH ELSE IF ASC(A$) = 27 THEN FullScreen = 0: _FULLSCREEN _OFF
GOTO GetTileInput
SlideTile:
_PRINTSTRING (823, 680), " Choose a Space to Slide Tile to or "
_PRINTSTRING (823, 718), " Choose a Different Tile to Slide "
GetSlideInput:
DO WHILE _MOUSEINPUT
FOR Z = 1 TO 6
FOR Y = 1 TO 6
IF _MOUSEX > BoardX(Z, Y) - 57 AND _MOUSEX < BoardX(Z, Y) + 57 AND _MOUSEY > BoardY(Z, Y) - 57 AND _MOUSEY < BoardY(Z, Y) + 57 THEN Selected = 1 ELSE Selected = 0
IF _MOUSEBUTTON(1) = -1 AND Selected = 1 THEN
GOSUB ReleaseButton
IF Playable(Z, Y) = 1 THEN
IF Row = Z AND Column = Y THEN ClearCursors: GOTO ChooseTile ELSE ClearCursors: GOTO MoveTile
ELSE
IF BoardTile(Z, Y) > 0 THEN ClearCursors: IF GetPlayables(Z, Y) = 1 THEN DrawCursor BoardX(Z, Y), BoardY(Z, Y), 0: GOTO SlideTile ELSE GOTO GetSlideInput
END IF
END IF
NEXT
NEXT
LOOP
A$ = INKEY$: IF A$ <> "" THEN IF ASC(A$) = 27 AND FullScreen = 0 THEN FullScreen = -1: _FULLSCREEN _SQUAREPIXELS , _SMOOTH ELSE IF ASC(A$) = 27 THEN FullScreen = 0: _FULLSCREEN _OFF
GOTO GetSlideInput
IF Slide = 1 THEN GOTO ChooseTile ELSE GOTO EndRound
TileChosen:
_PRINTSTRING (823, 680), " Choose a Board Space or "
_PRINTSTRING (823, 718), " Choose a Different Tile to Play "
GetBoardInput:
DO WHILE _MOUSEINPUT
' Choose a Different Tile
FOR Z = 1 TO 6
IF _MOUSEX > DisplayX(Z) - 57 AND _MOUSEX < DisplayX(Z) + 57 AND _MOUSEY > DisplayY(Z) - 57 AND _MOUSEY < DisplayY(Z) + 57 THEN Selected = 1 ELSE Selected = 0
IF _MOUSEBUTTON(1) = -1 AND Selected = 1 AND DisplayTile(Z) > 0 THEN
GOSUB ReleaseButton: DrawCursor DisplayX(Position), DisplayY(Position), 11
IF Z = Position GOTO ChooseTile ELSE Tile = DisplayTile(Z): Position = Z:: DrawCursor DisplayX(Z), DisplayY(Z), 0: GOTO GetBoardInput
END IF
NEXT
' Choose Board Space to Place Tile
FOR Z = 1 TO 6
FOR Y = 1 TO 6
IF _MOUSEX > BoardX(Z, Y) - 57 AND _MOUSEX < BoardX(Z, Y) + 57 AND _MOUSEY > BoardY(Z, Y) - 57 AND _MOUSEY < BoardY(Z, Y) + 57 THEN Selected = 1 ELSE Selected = 0
IF _MOUSEBUTTON(1) = -1 AND Selected AND BoardTile(Z, Y) = 0 THEN GOSUB ReleaseButton: Row = Z: Column = Y: GOTO PlaceTile
NEXT
NEXT
LOOP
A$ = INKEY$: IF A$ <> "" THEN IF ASC(A$) = 27 AND FullScreen = 0 THEN FullScreen = -1: _FULLSCREEN _SQUAREPIXELS , _SMOOTH ELSE IF ASC(A$) = 27 THEN FullScreen = 0: _FULLSCREEN _OFF
GOTO GetBoardInput
IF Winner = 3 THEN
_PRINTSTRING (823, 685), " The Game Ended in a Tie "
ELSE
_PRINTSTRING (823, 685), " Player " + STR$(Winner) + " is the Winner! "
END IF
_PRINTSTRING (823, 718), " Play Another Game? ( Y or N) "
YorN: A$ = UCASE$(INKEY$): IF A$ = "" GOTO YorN
IF ASC(A$) = 27 AND FullScreen = 0 THEN FullScreen = -1: _FULLSCREEN _SQUAREPIXELS , _SMOOTH ELSE IF ASC(A$) = 27 THEN FullScreen = 0: _FULLSCREEN _OFF
IF A$ = "Y" THEN RUN
IF A$ = "N" THEN SYSTEM
GOTO YorN
FOR Z = 1 TO 6
FOR Y = 1 TO 6
Playable(Z, Y) = 0: DrawCursor BoardX(Z, Y), BoardY(Z, Y), 15
NEXT
NEXT
END SUB
FUNCTION GetPlayables (X1, X2)
' Clear All Playables
FOR Z = 1 TO 6: FOR Y = 1 TO 6: Playable(Z, Y) = 0: NEXT: NEXT: Playable(X1, X2) = 1: V = 0
X = 0
CheckUp:
IF X1 - X - 1 >= 1 THEN
IF BoardTile(X1 - X - 1, X2) = 0 THEN Playable(X1 - X - 1, X2) = 1: DrawCursor BoardX(X1 - X - 1, X2), BoardY(X1 - X - 1, X2), 0: X = X + 1: V = 1: GOTO CheckUp
END IF
X = 0
CheckDown:
IF X1 + X + 1 <= 6 THEN
IF BoardTile(X1 + X + 1, X2) = 0 THEN Playable(X1 + X + 1, X2) = 1: DrawCursor BoardX(X1 + X + 1, X2), BoardY(X1 + X + 1, X2), 0: X = X + 1: V = 1: GOTO CheckDown
END IF
X = 0
CheckLeft:
IF X2 - X - 1 >= 1 THEN
IF BoardTile(X1, X2 - X - 1) = 0 THEN Playable(X1, X2 - X - 1) = 1: DrawCursor BoardX(X1, X2 - X - 1), BoardY(X1, X2 - X - 1), 0: X = X + 1: V = 1: GOTO CheckLeft
END IF
X = 0
CheckRight:
IF X2 + X + 1 <= 6 THEN
IF BoardTile(X1, X2 + X + 1) = 0 THEN Playable(X1, X2 + X + 1) = 1: DrawCursor BoardX(X1, X2 + X + 1), BoardY(X1, X2 + X + 1), 0: X = X + 1: V = 1: GOTO CheckRight
END IF
GetPlayables = V
END FUNCTION
FUNCTION EndOfGame ()
' Get Tile Shapes and Colors
FOR Z = 1 TO 6
FOR Y = 1 TO 6
BoardShape(Z, Y) = TileShape(BoardTile(Z, Y)): BoardColor(Z, Y) = TileColor(BoardTile(Z, Y)): BoardShapeGroup(Z, Y) = 0: BoardColorGroup(Z, Y) = 0
NEXT
NEXT
' Set ShapeGroupCount, ShapeGroupScore, ColorGroupCount and ColorGroupScore to 0
FOR Z = 1 TO 6: FOR Y = 1 TO 6: ShapeGroupCount(Z, Y) = 0: ShapeGroupScore(Z, Y) = 0: ColorGroupCount(Z, Y) = 0: ColorGroupScore(Z, Y) = 0: NEXT: NEXT
PatternShapes = 0: PatternColors = 0
' Get Tile Shape Group
FOR Z = 1 TO 6
FOR Y = 1 TO 6
Shape = BoardShape(Z, Y)
IF Y - 1 >= 1 AND Z - 1 >= 1 THEN
Group1 = BoardShapeGroup(Z, Y - 1): Group2 = BoardShapeGroup(Z - 1, Y)
IF BoardShape(Z, Y - 1) = Shape AND BoardShape(Z - 1, Y) = Shape THEN
IF Group1 <> Group2 THEN
IF Group1 < Group2 THEN
ChangeShapeGroup Shape, Group1, Group2: BoardShapeGroup(Z, Y) = Group1
ELSE
ChangeShapeGroup Shape, Group2, Group1: BoardShapeGroup(Z, Y) = Group2
END IF
ELSE
BoardShapeGroup(Z, Y) = Group1
END IF
ELSE
X = 0
IF BoardShape(Z, Y - 1) = Shape THEN BoardShapeGroup(Z, Y) = Group1: X = 1
IF BoardShape(Z - 1, Y) = Shape THEN BoardShapeGroup(Z, Y) = Group2: X = 1
IF X = 0 THEN BoardShapeGroup(Z, Y) = NextShapeGroup(Shape)
END IF
ELSEIF Y - 1 >= 1 THEN
IF BoardShape(Z, Y - 1) = BoardShape(Z, Y) THEN
BoardShapeGroup(Z, Y) = BoardShapeGroup(Z, Y - 1)
ELSE
BoardShapeGroup(Z, Y) = NextShapeGroup(Shape)
END IF
ELSEIF Z - 1 >= 1 THEN
IF BoardShape(Z - 1, Y) = BoardShape(Z, Y) THEN
BoardShapeGroup(Z, Y) = BoardShapeGroup(Z - 1, Y)
ELSE
BoardShapeGroup(Z, Y) = NextShapeGroup(Shape)
END IF
ELSE
BoardShapeGroup(Z, Y) = NextShapeGroup(Shape)
END IF
NEXT
NEXT
' Get Tile Color Group
FOR Z = 1 TO 6
FOR Y = 1 TO 6
Colour = BoardColor(Z, Y)
IF Y - 1 >= 1 AND Z - 1 >= 1 THEN
Group1 = BoardColorGroup(Z, Y - 1): Group2 = BoardColorGroup(Z - 1, Y)
IF BoardColor(Z, Y - 1) = Colour AND BoardColor(Z - 1, Y) = Colour THEN
IF Color1 <> Color2 THEN
IF Color1 < Color2 THEN
ChangeColorGroup Colour, Group1, Group2: BoardColorGroup(Z, Y) = Group1
ELSE
ChangeColorGroup Colour, Group2, Group1: BoardColorGroup(Z, Y) = Group2
END IF
ELSE
BoardColorGroup(Z, Y) = Group1
END IF
ELSE
X = 0
IF BoardColor(Z, Y - 1) = Colour THEN BoardColorGroup(Z, Y) = Group1: X = 1
IF BoardColor(Z - 1, Y) = Colour THEN BoardColorGroup(Z, Y) = Group2: X = 1
IF X = 0 THEN BoardColorGroup(Z, Y) = NextColorGroup(Colour)
END IF
ELSEIF Y - 1 >= 1 THEN
IF BoardColor(Z, Y - 1) = BoardColor(Z, Y) THEN
BoardColorGroup(Z, Y) = BoardColorGroup(Z, Y - 1)
ELSE
BoardColorGroup(Z, Y) = NextColorGroup(Colour)
END IF
ELSEIF Z - 1 >= 1 THEN
IF BoardColor(Z - 1, Y) = BoardColor(Z, Y) THEN
BoardColorGroup(Z, Y) = BoardColorGroup(Z - 1, Y)
ELSE
BoardColorGroup(Z, Y) = NextColorGroup(Colour)
END IF
ELSE
BoardColorGroup(Z, Y) = NextColorGroup(Colour)
END IF
NEXT
PRINT
NEXT
' Set Group Counts to 0
FOR Z = 1 TO 6: FOR Y = 1 TO 6: ShapeGroupCount(Z, Y) = 0: ColorGroupCount(Z, Y) = 0: NEXT: NEXT
' Count Each Group
FOR Z = 1 TO 6
FOR Y = 1 TO 6
ShapeGroupCount(BoardShape(Z, Y), BoardShapeGroup(Z, Y)) = ShapeGroupCount(BoardShape(Z, Y), BoardShapeGroup(Z, Y)) + 1
ColorGroupCount(BoardColor(Z, Y), BoardColorGroup(Z, Y)) = ColorGroupCount(BoardColor(Z, Y), BoardColorGroup(Z, Y)) + 1
NEXT
NEXT
' Get Points for Each Group
FOR Z = 1 TO 6
FOR Y = 1 TO 6
ShapeGroupScore(Z, Y) = Points(ShapeGroupCount(Z, Y)): ColorGroupScore(Z, Y) = Points(ColorGroupCount(Z, Y))
NEXT
NEXT
' Get Scores for Each Shape and Color
FOR Z = 1 TO 6
ShapeScore(Z) = ShapeGroupScore(Z, 1) + ShapeGroupScore(Z, 2) + ShapeGroupScore(Z, 3) + ShapeGroupScore(Z, 4) + ShapeGroupScore(Z, 5) + ShapeGroupScore(Z, 6)
ColorScore(Z) = ColorGroupScore(Z, 1) + ColorGroupScore(Z, 2) + ColorGroupScore(Z, 3) + ColorGroupScore(Z, 4) + ColorGroupScore(Z, 5) + ColorGroupScore(Z, 6)
NEXT
' Determine the Winner
IF PlayerScore(1) > PlayerScore(2) THEN Winner = 1 ELSE IF PlayerScore(2) > PlayerScore(1) THEN Winner = 2 ELSE Winner = 3
EndOfGame = Winner
END FUNCTION
SUB ChangeShapeGroup (Shape, A, B)
ShapeGroupOk(Shape, B) = 1
FOR Z = 1 TO 6
FOR Y = 1 TO 6
IF BoardShape(Z, Y) = Shape AND BoardShapeGroup(Z, Y) = B THEN BoardShapeGroup(Z, Y) = A
NEXT
NEXT
END SUB
SUB ChangeColorGroup (Colour, A, B)
ColorGroupOk(Colour, B) = 1
FOR Z = 1 TO 6
FOR Y = 1 TO 6
IF BoardColor(Z, Y) = Colour AND BoardColorGroup(Z, Y) = B THEN BoardColorGroup(Z, Y) = A
NEXT
NEXT
END SUB
FUNCTION NextShapeGroup (Shape)
X = 1
GetX: IF ShapeGroupOk(Shape, X) = 1 THEN ShapeGroupOk(Shape, X) = 0: NextShapeGroup = X ELSE X = X + 1: GOTO GetX
END FUNCTION
FUNCTION NextColorGroup (Colour)
X = 1
GetX: IF ColorGroupOk(Colour, X) = 1 THEN ColorGroupOk(Colour, X) = 0: NextColorGroup = X ELSE X = X + 1: GOTO GetX
END FUNCTION
SUB DisplayScores
LINE (772, 80)-(1296, 751), 11, BF
' Displau Player Info
COLOR 0, 11: _PRINTSTRING (800, 65), " Player 1 Player 2 "
COLOR 0, 11: _PRINTSTRING (800, 90), "Group Same Shape Group Same Color"
X = 165
FOR Z = 1 TO 6
DrawTile 870, X, Z, 10, 0: _PRINTSTRING (940, X - 10), STR$(ShapeScore(Z))
DrawTile 1145, X, 5, Z, 0: _PRINTSTRING (1215, X - 10), STR$(ColorScore(Z))
X = X + 85
NEXT
Here's another board game. I borrowed 6 shapes and colors from my Niya game. I've included the scouse code, description of the game, screenshot of the game and a picture of the actual game I changed the shapes.
This question pertains to my work on the hardware acceleration lesson in the tutorial.
According to the Wiki _PUTIMAGE should be allowed to use hardware images as either the source or destination. However this is not working for me. Please take a look at the sample code I included below. Am I missing something obvious or does the Wiki need updating?
Code: (Select All)
OPTION _EXPLICIT ' declare those variables son!
DIM SWimage AS LONG ' software image
DIM HWimage AS LONG ' hardware image
SCREEN _NEWIMAGE(640, 480, 32) ' create a software surface
SWimage = _NEWIMAGE(100, 100, 32) ' create a software image
_DEST SWimage ' draw on the software image
CIRCLE (49, 49), 49 ' create a full size circle on the software image
HWimage = _COPYIMAGE(SWimage, 33) ' create a hardware version of the software image
CLS ' clear the software image
CIRCLE (49, 49), 24 ' create a half size circle on the software image
_DEST 0 ' return to the software surface
_PUTIMAGE (0, 0), SWimage ' place the software image onto the software surface
'+------------------------------------------------------------------------------------------------------------------+
'| According to the Wiki _PUTIMAGE should be allowed to use hardware images, however it's not working. |
'| |
'| "Hardware images (created using mode 33 via _LOADIMAGE or _COPYIMAGE) can be used as the source or destination." |
'| |
'| The quote above was taken directly from the Wiki. |
'+------------------------------------------------------------------------------------------------------------------+
'_PUTIMAGE (0, 0), HWimage, SWimage ' nope, invalid handle <<--- neither one of these work?
'_PUTIMAGE (0, 0), SWimage, HWimage ' nope, invalid handle <<---
DO
_LIMIT 15 ' slow down hoss
_PUTIMAGE (0, 0), HWimage ' draw the hardware image over the software image
_DISPLAY ' update the surfaces
LOOP UNTIL _KEYDOWN(27) ' leave when ESC pressed
_FREEIMAGE SWimage
_FREEIMAGE HWimage
I have never taken advantage of the Calendar. I see where there would be 2 different types - a public calendar and a private calendar. Was there a particular use intended for the public calendar? Also, on the private calendar, what features are available like color, events v's tasks, personal notifications, can I add photos or documents etc I didn't see any info on the calendar in the wiki, so I apologize if there is a tutorial on it that I missed. thanks
I've been trying to load a font from string memory, like @a740g did HERE, but none of my font string data will work like a740g code does. i must not be doing it right. Here's what I'm doing.
I'm first loading the entire .otf font file data into a string named fontdata$. Then I try to load the font from fontdata$ memory like this.
When I try to print several lines of text, all indented to the same tab point (tab14), the lines are separated by a blank line.
Wiki says "Column tab prints may not always move 9 spaces past the center of the screen. Some may move text to next row.", which seems a bit "iffy".
Is there a firm rule that applies here, or must I resort to a new Locate command?
elcircle is a pretty quick subroutine to draw filled ellipses (and circles) that doesn't have the problems using Paint does. It's not a fast as fcircle but it's speedy and it can do ellipses.
Code: (Select All)
'elcircle demo
' by James D. Jarvis
' a fast subroutine to fill an ellipsoid or a circlc without using PAINT
'expanded from a circle routine by Chuck Venoit here https://basicanywheremachine-news.blogsp...nVdETyxJk4
Screen _NewImage(800, 500, 256)
Randomize Timer
e = 64000
t1 = Timer
For c = 1 To e
elcircle Rnd * _Width, Rnd * _Height, Int(10 + c / 1000), 1.5, Int(Rnd * 256)
Next c
t2 = Timer
For c = 1 To e
elcircle2 Rnd * _Width, Rnd * _Height, Int(10 + c / 1000), 0.5, Int(Rnd * 256)
Next c
t3 = Timer
Print "elcircle"; t2 - t1; " elcircle 2 "; t3 - t2; " press any key to continue"
Sleep
Cls
Print "use standard circle comands if you wish to add a 1 pixel outline to the circles"
elcircle 200, 200, 100, 0.5, 12
Circle (200, 200), 100, 15, , , 0.5
elcircle 400, 200, 100, 3.5, 12
Circle (400, 200), 100, 15, , , 3.5
Sub elcircle (cx, cy, crad, aspectr, klr As _Unsigned Long)
'elcircle does not render correctly if ascpect ratio is <1
If aspectr < 1 Then
elcircle2 cx, cy, crad, aspectr, klr
Else
For xy = 0 To crad * 0.75
a = Sqr(crad * crad - xy * xy)
a_ar = a / aspectr
xy_ar = xy / aspectr
Line (cx - a_ar, cy - xy)-(cx + a_ar, cy - xy), klr, BF
Line (cx - a_ar, cy + xy)-(cx + a_ar, cy + xy), klr, BF
Line (cx - xy_ar, cy - a)-(cx + xy_ar, cy - a), klr, BF
Line (cx - xy_ar, cy + a)-(cx + xy_ar, cy + a), klr, BF
Next xy
End If
End Sub
Sub elcircle2 (cx, cy, crad, aspectr, klr As _Unsigned Long)
'elcircle2 renders aspect ratios <1 correctly but it is slower than elcircle itself
For xy = 0 To (crad * 0.75)
a = Sqr(crad * crad - xy * xy)
a_ar = a * aspectr
xy_ar = xy * aspectr
Line (cx - xy, cy + a_ar)-(cx + xy, cy - a_ar), klr, BF
Line (cx - a, cy + xy_ar)-(cx + a, cy - xy_ar), klr, BF
Next xy
End Sub