Small Basic Forum
Draw sample - Printable Version

+- Small Basic Forum (https://litdev.uk/mybb)
+-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1)
+--- Forum: Extensions (https://litdev.uk/mybb/forumdisplay.php?fid=3)
+--- Thread: Draw sample (/showthread.php?tid=557)



Draw sample - martmen - 01-25-2026

Hello everyone,
Here is a small drawing program using commands from the LitDev extension. Import TPJB64.000.

I'm still missing two subroutines:
Sub MoveObjektWithMouse
Sub RotateObjectWitheMouse

It could also be extended with additional objects.
Anyone who’s interested is welcome to take this as a challenge and share their own version here.

Best regards
MartMen
   


RE: Draw sample - AbsoluteBeginner - 01-26-2026

Hello, martmen  Shy

Good job.
Did you use AI to create this code?
It's trendy to use AI these days.  Wink


RE: Draw sample - litdev - 01-26-2026

Nice program, clearly not written with AI - mostly because it works and has good structure using SB commands concisely. 

This is my effort for MoveObjektWithMouse using HI, TPJB64.000-0


RE: Draw sample - martmen - 01-26-2026

You’re both right and wrong.
I programmed the initialization and event routines myself. I also created the main loop with the reactions to button clicks and set up the corresponding subroutines. Then I had the AI Copilot generate the routine for drawing a circle. Naturally, it didn’t work correctly at first. Once the routine was working properly, I handed the entire program over to Copilot and had it generate the remaining subroutines one after another. That worked well. But when I tried to have Copilot create the last three subroutines, it produced nothing but garbage. So I programmed the color‑change routine myself. Finally, I handed the whole program over to Copilot again and asked it to insert comments. That worked beautifully.
Since LitDev has added the move routine here, I’ll ask Copilot this evening to create the rotate routine. Let’s see what comes out of it.
Many thanks to LitDev — the move routine works perfectly. When will there be an update to the LitDev extension? There are quite a few improvements pending.
When I have time, I’ll add more drawing objects. I’ll also make the pen width freely selectable.


RE: Draw sample - martmen - 01-26-2026

New Version TPJB64.000-1

Its so good.


RE: Draw sample - litdev - 01-27-2026

I find AI generally not much help, but I guess it has its place for routine stuff.
Will be interested to see how rotation works, especially for triangles which won't be so simple without HI, but maybe I be surprised by it.
What outstanding extension things do you mean, I didn't actually know there were any.


RE: Draw sample - litdev - 01-27-2026

My version with star polygon and HI rotations for triangles and polygons, and some reduced flicker code, JWRB189.000

PS Didn't see your last post as a separate post - the version with your extra stuff and rotations.  The rotations are not about shape center for triangles as I suspected by AI, also rotations are not cumulative from previous rotation - this is my experience of AI - for very simple repetative tasks or syntax it is useful as a starting point, but for anything that it probably hasn't seen before is pretty rubbish and fixing it takes longer than understanding how to do it.  Would be interested if you could get AI to rotate triangles or polygons about their center, especially following a Move, without giving it my code of course.


RE: Draw sample - martmen - 01-27-2026

New version TPJB64.000-3
The program has been expanded and modified with additional buttons. Input for stars and polygons has been added. Since the buttons now appear in two separate areas, the value 30 in the initialization line
BX = BX + 30 + LDShapes.Width(B[i])
needs to be adjusted to match the screen size.
Not everything has been programmed yet, but you can already see the direction in which the program is developing. With FillColour, it should be possible to change the color of an object afterwards.
Yes, the rotation of triangles and the zooming are still problems that need to be solved.


RE: Draw sample - WhTurner - 01-27-2026

In the Challenges part of this forum are some solutions for the rotation of triangles in Challenge 12