Teletext paint program

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
User avatar
FourthStone
Posts: 998
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Sat Aug 08, 2020 12:15 am

Richard Russell wrote:
Sat Aug 08, 2020 12:05 am
As noted earlier in the thread, using S% to hold a pointer won't work in BBC BASIC for SDL 2.0 or Matrix Brandy when running on a 64-bit platform. You need to use S%% or plain S (I prefer the latter because it maintains compatibility with earlier versions of BBC BASIC). Alternatively you could use a regular array rather than indirection to avoid the problem altogether:

Code: Select all

      DIM S%(5)
      S%() = &01,&02,&04,&08,&10,&40
If you're targetting only BB4W, BBCSDL or Matrix Brandy you could use a byte array, but again this introduces an incompatibility with earlier versions and the memory saving is insignificant (6 bytes rather than 24):

Code: Select all

      DIM S&(5)
      S&() = &01,&02,&04,&08,&10,&40
Strange as I'm doing all the coding in BBCSDL 2.0 and it appears to work, but I will change it if required to make it more compatible.

User avatar
Richard Russell
Posts: 1658
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Teletext paint program

Post by Richard Russell » Sat Aug 08, 2020 12:50 am

FourthStone wrote:
Sat Aug 08, 2020 12:15 am
Strange as I'm doing all the coding in BBCSDL 2.0 and it appears to work.
On what platform? On Windows, Raspbian and Android it will work, because they are 32-bits. On MacOS and iOS it definitely won't work, because they are 64-bits and DIM always returns addresses outside the 32-bit range. On (64-bit) Linux it's more a matter of luck whether it will or won't.

User avatar
FourthStone
Posts: 998
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Sat Aug 08, 2020 1:46 am

Richard Russell wrote:
Sat Aug 08, 2020 12:50 am
FourthStone wrote:
Sat Aug 08, 2020 12:15 am
Strange as I'm doing all the coding in BBCSDL 2.0 and it appears to work.
On what platform? On Windows, Raspbian and Android it will work, because they are 32-bits. On MacOS and iOS it definitely won't work, because they are 64-bits and DIM always returns addresses outside the 32-bit range. On (64-bit) Linux it's more a matter of luck whether it will or won't.
Ahhh! Yes Windows so 32bit, I had a little think about it and came up with an algorithm to do the same thing without an array.

Code: Select all

      MODE 7

      REM TURN OFF CURSOR
      VDU 23,1,0;0;0;0;

      MOUSE ON 0

      PROCGR

      OLD_PX%=0
      OLD_PY%=0

      OLD_MX%=0
      OLD_MY%=0

      REPEAT
        MOUSE X,Y,Z
        IF X<>OLD_MX% OR Y<>OLD_MY% THEN
          TX%=X DIV 32
          TY%=(999-Y) DIV 40

          PX%=X DIV 16
          PY%=(999-Y)/13.3333333

          PRINTTAB(0,0)SPC(40)
          PRINTTAB(0,0)"MX:";STR$(X);" MY:";STR$(Y);" TX:";STR$(TX%);" TY:";STR$(TY%);" PX:";STR$(PX%);" PY:";STR$(PY%)

          IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
            IF OLD_PX%>1 AND OLD_PX%<80 AND OLD_PY%>2 AND OLD_PY%<75 THEN
              PROCPLOT(OLD_PX%,OLD_PY%,0)
            ENDIF

            OLD_PX%=PX%
            OLD_PY%=PY%

            IF OLD_PX%>1 AND OLD_PX%<80 AND OLD_PY%>2 AND OLD_PY%<75 THEN
              PROCPLOT(OLD_PX%,OLD_PY%,1)
            ENDIF

          ENDIF

          OLD_MX%=X
          OLD_MY%=Y

        ELSE
          WAIT 2
        ENDIF

      UNTIL 0

      END

      REM PLOT A MODE 7 SIXEL
      DEF PROCPLOT(X%,Y%,D%)

      LOCAL C%,A%

      VDU 31,X% DIV2, Y% DIV3

      REM CALCULATE SIXEL ELEMENT
      C%=(X% AND 1)+(Y% MOD 3)*2
      C%=2^C% - (C%=5)*32

      A%=135

      IF D% THEN
        VDU (USR &FFF4 AND &FF00) DIV256 OR C% OR 128
      ELSE
        VDU (USR &FFF4 AND &FF00) DIV256 -C% OR 128
      ENDIF

      ENDPROC

      REM INITIALISE THE SCREEN
      DEF PROCGR

      REM CLS
      VDU 12

      REM ADD GRAPHICS CODE TO LEFT SIDE OF CANVAS
      FOR Y%=1 TO 24
        PRINTTAB(0,Y%) CHR$(145+Y% MOD7);CHR$(255);
      NEXT

      REM PRINT PALETTE, NO NEED TO PRINT BLACK
      FOR count%=1 TO 7
        PRINTTAB(count%*4-3,0) CHR$(144+count%);CHR$(255);CHR$(255);
      NEXT count%
      PRINTTAB(29,0) CHR$(135);"PDCLS"

      ENDPROC

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sat Aug 08, 2020 9:04 am

I forgot what you said Richard and that reminder is most welcome ( about the DIM command).

I am tidying up the code as well now. Having the basic blocks will allow me to add to this as time goes on.

Cheers both of you for looking through the code. I am learning so much going through this process of writing a program.

User avatar
Richard Russell
Posts: 1658
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Teletext paint program

Post by Richard Russell » Sat Aug 08, 2020 10:05 am

pixelblip wrote:
Sat Aug 08, 2020 9:04 am
I forgot what you said Richard and that reminder is most welcome ( about the DIM command).
My general recommendation is to avoid indirection altogether. It's very 'low level' (dealing as it does with machine addresses and direct memory peeks/pokes) and there's no protection against corrupting memory that you shouldn't, which is likely to have effects from making your program unstable to crashing out catastrophically.

Pretty much anything that indirection was used for in the 'old days' has a more satisfactory modern alternative. If using it as a byte array (as in this case) you can generally replace it with a regular array DIM array&(n) and if using it to build a complex data structure you can generally substitute 'proper' structures DIM struct{...}.

Obviously compatibility suffers in both cases, but increasingly the 'modern' versions of BBC BASIC are coming into line (Matrix Brandy already supports byte arrays and I'm looking forward to it supporting structures as well :lol:).

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sat Aug 08, 2020 10:19 am

Thanks Richard. Noted.
Also Fourthstone what you have done is 100* better. Much easier to understand. I also like the fact the brush moves with the pointer and stays on it. Well done for working that out. I wouldn't have been able to at this stage.
Attachments
New.PNG

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sat Aug 08, 2020 10:45 am

When I try and plot a point using your plot procedure Fourthstone I get this.....although the screen has a graphic character down the left side doesn't it.....
Attachments
draw.PNG

Soruk
Posts: 793
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Teletext paint program

Post by Soruk » Sat Aug 08, 2020 11:35 am

pixelblip wrote:
Sat Aug 08, 2020 10:45 am
When I try and plot a point using your plot procedure Fourthstone I get this.....although the screen has a graphic character down the left side doesn't it.....
In this bit...

Code: Select all

      IF D% THEN
        VDU (USR &FFF4 AND &FF00) DIV256 OR C% OR 128
      ELSE
        VDU (USR &FFF4 AND &FF00) DIV256 -C% OR 128
      ENDIF
Try ORing with 160 instead of 128.
Matrix Brandy BASIC VI (work in progress)

User avatar
Richard Russell
Posts: 1658
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Teletext paint program

Post by Richard Russell » Sat Aug 08, 2020 11:38 am

pixelblip wrote:
Sat Aug 08, 2020 10:45 am
although the screen has a graphic character down the left side doesn't it.....
I don't think Fourthstone's program has a text viewport to 'protect' the first column. Once that's added, the conversion from horizontal mouse coordinate to text column will need to be adjusted because the columns are then numbered 0-38, with what was column 1 becoming column 0.

There are other ways in which I think his program is something of a regression. For example both Soruk and I were recommending the use of GET(x,y) as being nicer and faster than OSBYTE 135, yet we're back to using that legacy method to read the characters from the screen. :?

Soruk
Posts: 793
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Teletext paint program

Post by Soruk » Sat Aug 08, 2020 11:41 am

Richard Russell wrote:
Sat Aug 08, 2020 11:38 am
pixelblip wrote:
Sat Aug 08, 2020 10:45 am
although the screen has a graphic character down the left side doesn't it.....
I don't think Fourthstone's program has a text viewport to 'protect' the first column. Once that's added, the conversion from horizontal mouse coordinate to text column will need to be adjusted because the columns are then numbered 0-38, with what was column 1 becoming column 0.

There are other ways in which I think his program is something of a regression. For example both Soruk and I were recommending the use of GET(x,y) as being nicer and faster than OSBYTE 135, yet we're back to using that legacy method to read the characters from the screen. :?
I can see why he was doing it that way, he'd already positioned the cursor to do the read, did his transform and immediately writes the character out. But yes, if he's only targeting BB4W, BBCSDL or Matrix Brandy then GET(x,y) is far more readable, and as Richard says, faster - certainly in Matrix Brandy there is no requirement to move the cursor to get the character (except in RISC OS, where it has to use the underlying OS calls so it needs to move the cursor, read using OS_Byte 135, then move the cursor back), and I would be surprised if that wasn't also true for BBCSDL and BB4W.
Matrix Brandy BASIC VI (work in progress)

User avatar
Richard Russell
Posts: 1658
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Teletext paint program

Post by Richard Russell » Sat Aug 08, 2020 11:55 am

Soruk wrote:
Sat Aug 08, 2020 11:41 am
I would be surprised if that wasn't also true for BBCSDL and BB4W.
Indeed, GET(x,y) is the lower-level operation; OSBYTE 135 is effectively GET(POS,VPOS) under the hood.

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sat Aug 08, 2020 12:08 pm

Thanks you two. ORing with 160 did the trick. It's just not quite painting with single pixels. It does 'feel better' when you paint though with the new co-ordinates.
Attachments
or160.PNG

User avatar
FourthStone
Posts: 998
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Sat Aug 08, 2020 3:29 pm

Try this, this program is a demonstration at this stage, not fully functioning but more an experimental framework to build on.

This one uses left mouse to draw, right mouse to erase, I fixed the erase by making it more robust and not a literal on / off definition.

Hopefully tomorrow I can add in a robust mouse trap for drawing.

Code: Select all

      MODE 7

      REM TURN OFF CURSOR
      VDU 23,1,0;0;0;0;

      MOUSE ON 0

      PROCGR

      OLD_PX%=0
      OLD_PY%=0

      OLD_MX%=0
      OLD_MY%=0

      MX%=0
      MY%=0
      MB%=0

      TX%=0
      TY%=0

      PX%=0
      PY%=0

      REPEAT
        PROCREADMOUSE

        REM ONLY UPDATE SCREEN IF MOUSE POSITION CHANGES
        IF MX%<>OLD_MX% OR MY%<>OLD_MY% OR MB%<>0 THEN

          REM SHOW ALL MOUSE TRACKING DETAILS
          REM PRINTTAB(0,0)SPC(40)
          REM PRINTTAB(0,0)"MX:";STR$(MX%);" MY:";STR$(MY%);" TX:";STR$(TX%);" TY:";STR$(TY%);" PX:";STR$(PX%);" PY:";STR$(PY%)


          REM UPDATE MOUSE POINTER IF SIXEL LOCATION CHANGES
          IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
            IF OLD_PX%>1 AND OLD_PX%<80 AND OLD_PY%>2 AND OLD_PY%<75 THEN
              REM                PROCPLOT(OLD_PX%,OLD_PY%,0)
            ENDIF

            OLD_PX%=PX%
            OLD_PY%=PY%

            IF OLD_PX%>1 AND OLD_PX%<80 AND OLD_PY%>2 AND OLD_PY%<75 THEN
              IF MB%=4 THEN
                PROCPLOT(OLD_PX%,OLD_PY%,1)
              ENDIF
              IF MB%=1 THEN
                PROCPLOT(OLD_PX%,OLD_PY%,0)
              ENDIF

            ENDIF

          ENDIF

          REM REMEMBER MOUSE POSITION
          OLD_MX%=MX%
          OLD_MY%=MY%

        ELSE
          REM PAUSE TO ALLOW OTHER EVENTS TO OCCUR
          WAIT 2
        ENDIF

      UNTIL 0

      END

      REM READ MOUSE AND CALCULATE TEXT AND SIXEL LOCATIONS
      DEF PROCREADMOUSE

      MOUSE MX%,MY%,MB%

      REM TEXT LOCATION RELEATIVE TO MOUSE
      TX%=MX% DIV 32
      TY%=(999-MY%) DIV 40

      REM SIXEL LOCATION RELEATIVE TO MOUSE
      PX%=MX% DIV 16
      PY%=(999-MY%)/13.3333333

      ENDPROC

      REM PLOT A MODE 7 SIXEL
      REM SIXEL COORDINATES WITH 0,0 BEING TOP LEFT THE SAME AS THE TEXT SCREEN
      DEF PROCPLOT(X%,Y%,D%)

      LOCAL C%,A%

      VDU 31,X% DIV2, Y% DIV3

      REM CALCULATE SIXEL ELEMENT
      REM 1  ,  2
      REM 4  ,  8
      REM 16 , 64
      C%=(X% AND 1)+(Y% MOD 3)*2
      C%=2^C% - (C%=5)*32

      A%=135

      IF D% THEN
        REM D%=1 ADD A SIXEL AT X%,Y%
        VDU (USR &FFF4 AND &FF00) DIV256 OR C% OR 128
      ELSE
        REM D%=0 REMOVE A SIXEL AT X%,Y%
        C%=255-C%
        VDU (USR &FFF4 AND &FF00) DIV256 AND C% OR 128
      ENDIF

      ENDPROC

      REM INITIALISE THE SCREEN
      DEF PROCGR

      REM CLS
      VDU 12

      REM ADD GRAPHICS CODE TO LEFT SIDE OF CANVAS
      FOR Y%=1 TO 24
        PRINTTAB(0,Y%) CHR$(145+Y% MOD7);CHR$(255);
      NEXT

      REM PRINT PALETTE, NO NEED TO PRINT BLACK
      FOR count%=1 TO 7
        PRINTTAB(count%*4-3,0) CHR$(144+count%);CHR$(255);CHR$(255);
      NEXT count%
      PRINTTAB(29,0) CHR$(135);"PDCLS"

      ENDPROC

User avatar
Richard Russell
Posts: 1658
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Teletext paint program

Post by Richard Russell » Sat Aug 08, 2020 5:00 pm

FourthStone wrote:
Sat Aug 08, 2020 3:29 pm
This one uses left mouse to draw, right mouse to erase,
The OP wants it to work on a touchscreen (indeed he has already had his code running in iOS, as mentioned early in the thread). How do you erase in that case?

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sat Aug 08, 2020 8:02 pm

I think I can sort that out Richard. In the routine Procplot D% is 0 plot or 1% erase.
So I can have a menu item at the top like an eraser letter and makes D%=1.

You are so good to help me all. I expect once the plot is ok then the other bits might be easier....
I have some good ideas once this is done that I can put into practise. I am looking forward to painting with this! :)

User avatar
FourthStone
Posts: 998
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Sat Aug 08, 2020 10:07 pm

My whole point was to get accurate mouse tracking which I think I've achieved..
Richard Russell wrote:
Sat Aug 08, 2020 11:38 am
pixelblip wrote:
Sat Aug 08, 2020 10:45 am
although the screen has a graphic character down the left side doesn't it.....
I don't think Fourthstone's program has a text viewport to 'protect' the first column. Once that's added, the conversion from horizontal mouse coordinate to text column will need to be adjusted because the columns are then numbered 0-38, with what was column 1 becoming column 0.
I use range checking which allows for the changing of the first char colour code.
Richard Russell wrote:
Sat Aug 08, 2020 11:38 am
There are other ways in which I think his program is something of a regression. For example both Soruk and I were recommending the use of GET(x,y) as being nicer and faster than OSBYTE 135, yet we're back to using that legacy method to read the characters from the screen. :?
Thanks, of course the program can be expanded once the core base if worked out, trying to fix everything in one go would become a full time job.. How is a demonstration of accurate mouse tracking a regression? Should we make it less accurate? ](*,)

I did see Soruk's Get and Put routines somewhere, I'll attempt to add these to the base.
Richard Russell wrote:
Sat Aug 08, 2020 5:00 pm
FourthStone wrote:
Sat Aug 08, 2020 3:29 pm
This one uses left mouse to draw, right mouse to erase,
The OP wants it to work on a touchscreen (indeed he has already had his code running in iOS, as mentioned early in the thread). How do you erase in that case?
I do understand what is wanted, I was merely offering a tech demo and bug fix to my initial code to show that it was possible to draw and erase pixels with accurate mouse tracking

I did qualify my submission with...
FourthStone wrote:
Fri Aug 07, 2020 11:13 pm
Had a look at the core loop, which to me is defining accurate mouse tracking and accurate plotting of pixels in mode 7.

So... here is the first stage of that effort which is a simple loop to track the mouse and plot and un-plot a pixel.

I made changes to the plot procedure so you need to keep that in mind if you are going to use my code. I made the pixel coordinates align with the text screen as to me it feels more intuitive. It could be modified back to 0,0 at bottom left but I found it just makes more sense having 0,0 at the top left to align with the text coordinates.

The other change I made to the plot routine was the ability to switch on or off a single pixel.

There are no draw routines just yet, I really wanted to flesh out a core loop with accurate mouse tracking and that is what we have below.

I'll see if I get time to add some of the drawing elements in so that you have a base that you can easily add more to.
Happy to take suggestions to progress this program but I think the starting point has always been a little blurry and I think I've fixed one of the core issues which was mouse tracking and speed. Hopefully we can build on that base some of the other things that been discussed and tried.

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sat Aug 08, 2020 10:15 pm

All help is *greatly* appreciated from all of you - and the tracking is much much better now Fourthstone. It feels more natural and is much less confusing to understand in terms of co-ordinates. I have said before but you all - Richard , Soruk Julie and yourself are very skilled. It is good to see debate on here and you discussing the best way forward. It's how I and others learn reading these conversations and debates!

Once the pixel plot is in place then it's like building blocks isn't it.....

I think it's marvelous we are going to get a paint program for Mode 7 - one that works on tablets - that is a brand new thing! It has always been keyboard based in the past.

The new system feels much better to paint with - it's like a brush in an art package. I have big plans once it is working. Oh and I won't forget my precious Mode 2! :lol:

User avatar
Richard Russell
Posts: 1658
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Teletext paint program

Post by Richard Russell » Sun Aug 09, 2020 12:01 am

pixelblip wrote:
Sat Aug 08, 2020 10:15 pm
All help is *greatly* appreciated from all of you
I am sorry that my earlier contributions turned out not to be very useful. :cry:

Not performing any coordinate range-checking in my code was in retrospect a poor decision; it stemmed from taking Rosetta Code examples and making the minimum changes necessary to adapt them to MODE 7. I should have anticipated that you would prefer something more 'bomb proof'.

User avatar
FourthStone
Posts: 998
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Sun Aug 09, 2020 2:04 am

Another little update, still a work in progress, nothing set in stone...

Left mouse draw, Right mouse erase, Middle mouse fill :D

Updated to use a modified version of Soruk's Point routines so no USR function.

Still work to do on the main loop, this is still just a demo for now but the core is coming together now. e.g. easy to add the fill routine and it all hangs together nice.

Next I'll work on the menu / tools so that you can start to add your own routines. Also found a bug in my fill routine so will debug that a bit too but it's fine for a demo.

Code: Select all

      MODE 7

      REM TURN OFF CURSOR
      VDU 23,1,0;0;0;0;

      MOUSE ON 0

      PROCGR

      REM drawing bounds
      xMin%=2
      xMax%=77
      yMin%=3
      yMax%=74

      REM fill bounds & BUFFER
      fxMin%=1
      fxMax%=80
      fyMin%=2
      fyMax%=75
      DIM fill{(100) x%,y%}

      REM OLD PIXEL & MOUSE COORDS
      OLD_PX%=0
      OLD_PY%=0
      OLD_MX%=0
      OLD_MY%=0

      REM MOUSE COORDS
      MX%=0
      MY%=0
      MB%=0

      REM TEXT & PIXEL COORDS FOR CURRENT MOUSE READ LOCATION
      TX%=0
      TY%=0
      PX%=0
      PY%=0

      REPEAT
        PROCREADMOUSE


        CASE MB% OF
          WHEN 1:
            PROCpoint(PX%,PY%,0)

          WHEN 2:
            PROCfloodFill(PX%,PY%)
            REPEAT
              PROCREADMOUSE
              WAIT 2
            UNTIL MB%=0

          WHEN 4:
            PROCpoint(PX%,PY%,1)

        ENDCASE


        REM SHOW ALL MOUSE TRACKING DETAILS
        REM PRINTTAB(0,0)SPC(40)
        REM PRINTTAB(0,0)"MX:";STR$(MX%);" MY:";STR$(MY%);" TX:";STR$(TX%);" TY:";STR$(TY%);" PX:";STR$(PX%);" PY:";STR$(PY%)


        REM REMEMBER MOUSE POSITION
        OLD_MX%=MX%
        OLD_MY%=MY%

      UNTIL 0

      END

      REM READ MOUSE AND CALCULATE TEXT AND SIXEL LOCATIONS
      DEF PROCREADMOUSE

      MOUSE MX%,MY%,MB%

      REM TEXT LOCATION RELEATIVE TO MOUSE
      TX%=MX% DIV 32
      TY%=(999-MY%) DIV 40

      REM SIXEL LOCATION RELEATIVE TO MOUSE
      PX%=MX% DIV 16
      PY%=(999-MY%)/13.3333333

      ENDPROC

      REM Read the point at the specified coordinates (1=set, 0=cleared)
      DEFFNpoint(x%,y%)
      LOCAL cx%,cy%,chr%,C%
      REM Get character cell
      cx% = x% DIV 2
      cy% = y% DIV 3
      chr%=GET(cx%,cy%) AND &5F
      C%=(x% AND 1)+(y% MOD 3)*2
      C%=2^C% - (C%=5)*32
      =SGN(chr% AND C%)

      REM Plot a Teletext sixel point
      REM SIXEL COORDINATES WITH 0,0 BEING TOP LEFT THE SAME AS THE TEXT SCREEN
      REM cmd% 0: Clear the point
      REM cmd% 1: Set the point
      REM cmd% 2: Toggle the point
      DEFPROCpoint(x%, y%, cmd%)

      IF x%>1 AND x%<80 AND y%>2 AND y%<75 THEN

        LOCAL cx%,cy%,chr%,C%
        REM Get character cell
        cx% = x% DIV 2
        cy% = y% DIV 3
        chr%=GET(cx%,cy%) AND &5F
        C%=(x% AND 1)+(y% MOD 3)*2
        C%=2^C% - (C%=5)*32
        CASE cmd% OF
          WHEN 0:chr% AND=(&5F - C%)
          WHEN 1:chr% OR=C%
          WHEN 2:chr% EOR=C%
        ENDCASE

        VDU 31,cx%, cy%,(chr%+160)
      ENDIF

      ENDPROC

      REM ### flood fill from ART4BBW
      DEF PROCfloodFill(sx%,sy%)

      IF sx%>fxMin% AND sx%<fxMax% AND sy%>fyMin% AND sy%<fyMax% THEN

        LOCAL uf,df,c%,x%,y%,mc%
        uf=0
        df=0

        REM fill with mask colour first
        bCnt%=0
        PROCaddFill(sx%,sy%)

        REPEAT
          REM get next fill point
          bCnt%-=1
          x%=fill{(bCnt%)}.x%
          y%=fill{(bCnt%)}.y%
          IF FNpoint(x%,y%) = 0 THEN

            uf=1 : df=1

            REM scan left
            WHILE x%>xMin% AND FNpoint(x%-1,y%) =0
              x%-=1
            ENDWHILE

            REM scan right
            WHILE x%<fxMax% AND FNpoint(x%,y%) = 0
              PROCpoint(x%,y%,1)

              REM detect colour changes above and add to list
              IF y%<fyMax% THEN
                c%=FNpoint(x%,y%+1)
                IF uf AND c%=0 THEN PROCaddFill(x%,y%+1) : uf=0
                IF c%=1 THEN uf=1
              ENDIF

              REM detect colour changes below and add to list
              IF y%>fyMin% THEN
                c%=FNpoint(x%,y%-1)
                IF df AND c%=0 THEN PROCaddFill(x%,y%-1) : df=0
                IF c%=1 THEN df=1
              ENDIF
              x%+=1
            ENDWHILE
          ENDIF

        UNTIL bCnt%=0
      ENDIF

      ENDPROC

      REM ### fill quasi stack
      DEF PROCaddFill(x%,y%)
      fill{(bCnt%)}.x%=x%
      fill{(bCnt%)}.y%=y%
      IF bCnt%<100 THEN bCnt%+=1
      ENDPROC


      REM INITIALISE THE SCREEN
      DEF PROCGR

      REM CLS
      VDU 12

      REM ADD GRAPHICS CODE TO LEFT SIDE OF CANVAS
      FOR Y%=1 TO 24
        PRINTTAB(0,Y%) CHR$(145+Y% MOD7);CHR$(255);
      NEXT

      REM PRINT PALETTE, NO NEED TO PRINT BLACK
      FOR count%=1 TO 7
        PRINTTAB(count%*4-3,0) CHR$(144+count%);CHR$(255);CHR$(255);
      NEXT count%
      PRINTTAB(29,0) CHR$(135);"PDCLS"

      ENDPROC

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sun Aug 09, 2020 3:34 am

Ahh thanks Fourthstone.......so much.
Richard - your code and time isn't wasted. We have to try things out as we go so it's all a learning process. If you hadn't have helped me I wouldn't even have a program so none of it is wasted. I haven't forgetten about what Julie said either! :)

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sun Aug 09, 2020 11:14 am

PS Fourthstone just saw you got fill in there! Sorry didn't see that before. Awesome!

User avatar
FourthStone
Posts: 998
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Sun Aug 09, 2020 11:02 pm

**** EDIT **** More progress, more tools added, it's starting to feel like a fun tool!

More progress, pretty happy with the core elements now and have started adding key tools as follows:

P - Paint tool
C - CLS
F - Fill tool
E - Eraser
U - Undo!! Currently limited to 20 undo actions, after 20 it loops around and replaces earlier undos.

ADDED!
D - Dither x2
2 - Dither x3
O - Circle
R - Rectangle
L - Line

Clicking the colour selectors changes the background colour for the whole picture, just a kludge for now until you workout how you want to use it.

I've made what I feel is a good addition to the toolbar in that the cursor stays under the currently selected tool and the colour selector changes to a star when changed BUT no colours are used for tools as yet, small steps as they say.

Obligatory disclaimer, this is a work in progress, may (probably) contain bugs, still needs tuning etc. etc. making it available for feedback and suggestions.

Code: Select all

      MODE 7

      MOUSE ON 0

      REM drawing bounds used for < and >
      xMin%=1
      xMax%=80
      yMin%=2
      yMax%=75


      REM fill bounds & BUFFER used with < and >
      fxMin%=2
      fxMax%=80
      fyMin%=3
      fyMax%=74
      DIM fill{(100) x%,y%}

      REM UNDO TEST ARRAY
      UNDO_MAX%=19
      DIM UNDO_BUFFER(UNDO_MAX%,959)
      UNDO_INDEX%=0

      REM OLD PIXEL & MOUSE COORDS
      OLD_PX%=0
      OLD_PY%=0
      OLD_MX%=0
      OLD_MY%=0

      REM MOUSE COORDS
      MX%=0
      MY%=0
      MB%=0

      REM TEXT & PIXEL COORDS FOR CURRENT MOUSE READ LOCATION
      TX%=0
      TY%=0
      PX%=0
      PY%=0

      REM TOOL VARS
      curcol%=7
      backcol%=7
      toolsel%=1
      toolcursor%=15

      PROCGR
      PROCdrawmenu

      REPEAT

        PROCREADMOUSE

        IF MX%<>OLD_MX% OR MY%<>OLD_MY% OR MB% THEN
          IF TY%=0 THEN
            REM CLICK INSIDE MENU AREA
            IF MB%=4 THEN
              CASE TX% OF
                WHEN 1: curcol%=1
                WHEN 3: curcol%=2
                WHEN 5: curcol%=3
                WHEN 7: curcol%=4
                WHEN 9: curcol%=5
                WHEN 11: curcol%=6
                WHEN 13: curcol%=7

                WHEN 15: toolsel%=1:toolcursor%=TX%: REM PAINT
                WHEN 16: toolsel%=2:toolcursor%=TX%: REM DITHER
                WHEN 17: toolsel%=3:toolcursor%=TX%: REM DITHER X2

                WHEN 19: REM CLEARSCREEN
                  PROCundosave
                  PROCGR

                WHEN 20: toolsel%=51:toolcursor%=TX%: REM CLEARPAPERCOL
                WHEN 21: toolsel%=6:toolcursor%=TX%: REM PAPERCOL

                WHEN 23: toolsel%=7:toolcursor%=TX%: REM CIRCEL
                WHEN 24: toolsel%=8:toolcursor%=TX%: REM RECTANGLE
                WHEN 25: toolsel%=9:toolcursor%=TX%: REM LINE
                WHEN 26: toolsel%=10:toolcursor%=TX%: REM FILL

                WHEN 28: toolsel%=12:toolcursor%=TX%: REM ERASER

                WHEN 30: toolsel%=12:toolcursor%=TX%: REM LOAD
                WHEN 31: toolsel%=12:toolcursor%=TX%: REM SAVE

                WHEN 33: PROCundorestore: REM ERASE


              ENDCASE

              REM CHANGE BACKGROUND COLOUR, TEMPORARY CLUDGE
              IF TX%<14 THEN
                FOR Y%=1 TO 24
                  PRINTTAB(0,Y%) CHR$(144+curcol%);
                NEXT
              ENDIF

              PROCdrawmenu

              REPEAT
                PROCREADMOUSE
                WAIT 2
              UNTIL MB%=0

            ENDIF

          ELSE
            REM CLICK INSIDE DRAWING AREA
            CASE MB% OF
              WHEN 1:
                REM PLACE HOLDER FOR RIGHT MOUSE

              WHEN 2:
                REM PLACE HOLDER FOR MIDDLE MOUSE

              WHEN 4:
                REM LEFT MOUSE CLICK OR TOUCH SCREEN CLICK
                CASE toolsel% OF
                  WHEN 1: REM PAINT TOOL
                    PROCundosave
                    PROCpoint(PX%,PY%,1)
                    REPEAT
                      PROCREADMOUSE
                      IF PX%<2 THEN PX%=2
                      IF PX%>79 THEN PX%=79
                      IF PY%<2 THEN PY%=2
                      IF PY%>74 THEN PY%=74
                      IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN PROCpoint(PX%,PY%,1)
                      OLD_PX%=PX%
                      OLD_PY%=PY%
                    UNTIL MB%=0

                  WHEN 2: REM DITHER TOOL
                    PROCundosave
                    X%=(PX% DIV 2)*2
                    Y%=(PY% DIV 2)*2
                    PROCpoint(X%,Y%,1)
                    PROCpoint(X%+2,Y%+2,1)
                    REPEAT
                      PROCREADMOUSE
                      IF PX%<2 THEN PX%=2
                      IF PX%>79 THEN PX%=79
                      IF PY%<2 THEN PY%=2
                      IF PY%>74 THEN PY%=74
                      IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                        X%=(PX% DIV 2)*2
                        Y%=(PY% DIV 2)*2
                        PROCpoint(X%,Y%,1)
                        PROCpoint(X%+2,Y%+2,1)
                      ENDIF
                      OLD_PX%=PX%
                      OLD_PY%=PY%
                    UNTIL MB%=0


                  WHEN 3: REM DITHER X2 TOOL
                    PROCundosave
                    X%=(PX% DIV 3)*3
                    Y%=(PY% DIV 3)*3
                    PROCpoint(X%,Y%,1)
                    PROCpoint(X%+3,Y%+3,1)
                    REPEAT
                      PROCREADMOUSE
                      IF PX%<2 THEN PX%=2
                      IF PX%>79 THEN PX%=79
                      IF PY%<2 THEN PY%=2
                      IF PY%>74 THEN PY%=74
                      IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                        X%=(PX% DIV 3)*3
                        Y%=(PY% DIV 3)*3
                        PROCpoint(X%,Y%,1)
                        PROCpoint(X%+3,Y%+3,1)
                      ENDIF
                      OLD_PX%=PX%
                      OLD_PY%=PY%
                    UNTIL MB%=0

                  WHEN 7: REM CIRCLE TOOL
                    PROCundosave
                    startx%=PX%: starty%=PY%
                    OLD_PX%=PX% : OLD_PY%=PY%
                    REM PROCpoint(startx%,starty%,2)

                    REPEAT
                      PROCREADMOUSE
                      IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                        PROCcircle(startx%,starty%,startx%-OLD_PX%,2)
                        PROCcircle(startx%,starty%,startx%-PX%,2)
                        OLD_PX%=PX%
                        OLD_PY%=PY%
                      ENDIF
                    UNTIL MB%=0
                    PROCcircle(startx%,starty%,startx%-PX%,1)

                  WHEN 8: REM RECTANGLE TOOL
                    PROCundosave
                    startx%=PX%: starty%=PY%
                    OLD_PX%=PX% : OLD_PY%=PY%
                    PROCpoint(startx%,starty%,2)

                    REPEAT
                      PROCREADMOUSE
                      IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                        PROCrectangle(startx%,starty%,OLD_PX%,OLD_PY%,2)
                        PROCrectangle(startx%,starty%,PX%,PY%,2)
                        OLD_PX%=PX%
                        OLD_PY%=PY%
                      ENDIF
                    UNTIL MB%=0
                    PROCrectangle(startx%,starty%,PX%,PY%,1)

                  WHEN 9: REM LINE TOOL
                    PROCundosave
                    startx%=PX%: starty%=PY%
                    OLD_PX%=PX% : OLD_PY%=PY%
                    PROCpoint(startx%,starty%,2)

                    REPEAT
                      PROCREADMOUSE
                      IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN
                        PROCbresenham(startx%,starty%,OLD_PX%,OLD_PY%,2)
                        PROCbresenham(startx%,starty%,PX%,PY%,2)
                        OLD_PX%=PX%
                        OLD_PY%=PY%
                      ENDIF
                    UNTIL MB%=0
                    PROCbresenham(startx%,starty%,PX%,PY%,1)

                  WHEN 10: REM FILL TOOL
                    PROCundosave
                    PROCfloodfill(PX%,PY%)
                    REPEAT
                      PROCREADMOUSE
                      WAIT 2
                    UNTIL MB%=0

                  WHEN 12: REM ERASER TOOL
                    PROCundosave
                    PROCpoint(PX%,PY%,0)
                    REPEAT
                      PROCREADMOUSE
                      IF PX%<2 THEN PX%=2
                      IF PX%>79 THEN PX%=79
                      IF PY%<2 THEN PY%=2
                      IF PY%>74 THEN PY%=74
                      IF PX%<>OLD_PX% OR PY%<>OLD_PY% THEN PROCpoint(PX%,PY%,0)
                      OLD_PX%=PX%
                      OLD_PY%=PY%
                    UNTIL MB%=0

                ENDCASE


            ENDCASE

          ENDIF

        ELSE
          WAIT 2
        ENDIF

        REM SHOW ALL MOUSE TRACKING DETAILS
        REM PRINTTAB(0,0)SPC(40)
        REM PRINTTAB(0,0)"MX:";STR$(MX%);" MY:";STR$(MY%);" TX:";STR$(TX%);" TY:";STR$(TY%);" PX:";STR$(PX%);" PY:";STR$(PY%)


        REM REMEMBER MOUSE POSITION
        OLD_MX%=MX%
        OLD_MY%=MY%

      UNTIL 0

      END

      REM READ MOUSE AND CALCULATE TEXT AND SIXEL LOCATIONS
      DEF PROCREADMOUSE

      MOUSE MX%,MY%,MB%

      REM TEXT LOCATION RELEATIVE TO MOUSE
      TX%=MX% DIV 32
      TY%=(999-MY%) DIV 40

      REM SIXEL LOCATION RELEATIVE TO MOUSE
      PX%=MX% DIV 16
      PY%=(999-MY%)/13.3333333

      VDU 31,toolcursor%,0
      ENDPROC

      REM Read the point at the specified coordinates (1=set, 0=cleared)
      DEFFNpoint(x%,y%)
      LOCAL cx%,cy%,chr%,C%
      REM Get character cell
      cx% = x% DIV 2
      cy% = y% DIV 3
      chr%=GET(cx%,cy%) AND &5F
      C%=(x% AND 1)+(y% MOD 3)*2
      C%=2^C% - (C%=5)*32
      =SGN(chr% AND C%)

      REM Plot a Teletext sixel point
      REM SIXEL COORDINATES WITH 0,0 BEING TOP LEFT THE SAME AS THE TEXT SCREEN
      REM cmd% 0: Clear the point
      REM cmd% 1: Set the point
      REM cmd% 2: Toggle the point
      DEFPROCpoint(x%, y%, cmd%)

      IF x%>xMin% AND x%<xMax% AND y%>yMin% AND y%<yMax% THEN

        LOCAL cx%,cy%,chr%,C%
        REM Get character cell
        cx% = x% DIV 2
        cy% = y% DIV 3
        chr%=GET(cx%,cy%) AND &5F
        C%=(x% AND 1)+(y% MOD 3)*2
        C%=2^C% - (C%=5)*32
        CASE cmd% OF
          WHEN 0:chr% AND=(&5F - C%)
          WHEN 1:chr% OR=C%
          WHEN 2:chr% EOR=C%
        ENDCASE

        VDU 31,cx%, cy%,(chr%+160)
      ENDIF

      ENDPROC

      REM LINE ROUTINE USE m% TO PERFORM 0=ERASE / 1=DRAW / 2=EOR
      DEF PROCbresenham(x1%,y1%,x2%,y2%,m%)
      LOCAL dx%, dy%, sx%, sy%, e
      dx% = ABS(x2% - x1%) : sx% = SGN(x2% - x1%)
      dy% = ABS(y2% - y1%) : sy% = SGN(y2% - y1%)
      IF dx% > dy% e = dx% / 2 ELSE e = dy% / 2
      REPEAT
        PROCpoint(x1%,y1%,m%)
        IF x1% = x2% IF y1% = y2% EXIT REPEAT
        IF dx% > dy% THEN
          x1% += sx% : e -= dy% : IF e < 0 e += dx% : y1% += sy%
        ELSE
          y1% += sy% : e -= dx% : IF e < 0 e += dy% : x1% += sx%
        ENDIF
      UNTIL FALSE
      ENDPROC

      REM RECTANGLE ROUTINE
      DEF PROCrectangle(x1%,y1%,x2%,y2%,m%)

      REM CHECK FOR SPECIAL CASES TO PRESERVE EOR OPERATIONS
      IF x1%=x2% AND y1%=y2% THEN
        PROCpoint(x1%,y1%,m%)
      ELSE
        IF x1%=x2% OR y1%=y2% THEN
          PROCbresenham(x1%,y1%,x2%,y2%,m%)
        ELSE
          PROCbresenham(x1%,y1%,x2%,y1%,m%)
          PROCbresenham(x1%,y2%,x2%,y2%,m%)
          IF ABS(y2%-y1%)>1 THEN
            IF y1%>y2% THEN SWAP y1%,y2%
            FOR Y%=y1%+1 TO y2%-1
              PROCpoint(x1%,Y%,m%)
              PROCpoint(x2%,Y%,m%)
            NEXT
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM CIRCLE ROUTINE
      DEF PROCcircle(x1%,y1%,r%,m%)
      LOCAL p,x%,y%

      r%=ABS(r%)
      p=(5-r%*4)/4
      x%=0
      y%=r%

      PROCcirclepoints(x1%,y1%,x%,y%,m%)

      WHILE x%<y%
        x%+=1
        IF p<0 THEN
          p+=2*x%+1
        ELSE
          y%-=1
          p+=2*(x%-y%)+1
        ENDIF
        PROCcirclepoints(x1%,y1%,x%,y%,m%)
      ENDWHILE

      ENDPROC

      REM THIS PLOTS THE POINTS FOR CIRCLE ROUTINE
      DEF PROCcirclepoints(cx%,cy%,x%,y%,m%)
      IF x%=0 THEN
        PROCpoint(cx%,cy%+y%,m%)
        PROCpoint(cx%,cy%-y%,m%)
        PROCpoint(cx%+y%,cy%,m%)
        PROCpoint(cx%-y%,cy%,m%)
      ELSE
        IF x%<=y% THEN
          PROCpoint(cx%+x%,cy%+y%,m%)
          PROCpoint(cx%-x%,cy%+y%,m%)
          PROCpoint(cx%+x%,cy%-y%,m%)
          PROCpoint(cx%-x%,cy%-y%,m%)
          IF x%<y% THEN
            PROCpoint(cx%+y%,cy%+x%,m%)
            PROCpoint(cx%-y%,cy%+x%,m%)
            PROCpoint(cx%+y%,cy%-x%,m%)
            PROCpoint(cx%-y%,cy%-x%,m%)
          ENDIF
        ENDIF
      ENDIF
      ENDPROC

      REM ### flood fill from ART4BBW
      DEF PROCfloodfill(sx%,sy%)

      IF sx%>xMin% AND sx%<xMax% AND sy%>yMin% AND sy%<yMax% THEN

        LOCAL uf,df,c%,x%,y%,mc%
        uf=0
        df=0

        REM fill with mask colour first
        bCnt%=0
        PROCaddFill(sx%,sy%)

        REPEAT
          REM get next fill point
          bCnt%-=1
          x%=fill{(bCnt%)}.x%
          y%=fill{(bCnt%)}.y%
          IF FNpoint(x%,y%) = 0 THEN

            uf=1 : df=1

            REM scan left
            WHILE x%>fxMin% AND FNpoint(x%-1,y%) =0
              x%-=1
            ENDWHILE

            REM scan right
            WHILE x%<fxMax% AND FNpoint(x%,y%) = 0
              PROCpoint(x%,y%,1)

              REM detect colour changes above and add to list
              IF y%<fyMax% THEN
                c%=FNpoint(x%,y%+1)
                IF uf AND c%=0 THEN PROCaddFill(x%,y%+1) : uf=0
                IF c%=1 THEN uf=1
              ENDIF

              REM detect colour changes below and add to list
              IF y%>fyMin% THEN
                c%=FNpoint(x%,y%-1)
                IF df AND c%=0 THEN PROCaddFill(x%,y%-1) : df=0
                IF c%=1 THEN df=1
              ENDIF
              x%+=1
            ENDWHILE
          ENDIF

        UNTIL bCnt%=0
      ENDIF

      ENDPROC

      REM ### fill quasi stack
      DEF PROCaddFill(x%,y%)
      fill{(bCnt%)}.x%=x%
      fill{(bCnt%)}.y%=y%
      IF bCnt%<100 THEN bCnt%+=1
      ENDPROC

      REM SAVE UNDO SCREEN
      DEF PROCundosave
      LOCAL U%
      UNDO_INDEX%+=1
      IF UNDO_INDEX%>UNDO_MAX% THEN UNDO_INDEX%=0

      FOR U%=0 TO 959
        UNDO_BUFFER(UNDO_INDEX%,U%)=GET(U% MOD 40,U% DIV 40+1)
      NEXT

      ENDPROC

      REM SAVE UNDO SCREEN
      DEF PROCundorestore
      LOCAL U%

      FOR U%=0 TO 959
        VDU 31,(U% MOD 40),(U% DIV 40+1),UNDO_BUFFER(UNDO_INDEX%,U%)
      NEXT

      UNDO_INDEX%-=1
      IF UNDO_INDEX%<0 THEN UNDO_INDEX%=UNDO_MAX%

      ENDPROC

      REM INITIALISE THE SCREEN
      DEF PROCGR

      REM CLS
      VDU 12

      REM ADD GRAPHICS CODE TO LEFT SIDE OF CANVAS
      FOR Y%=1 TO 24
        PRINTTAB(0,Y%) CHR$(144+curcol%);
      NEXT

      ENDPROC

      REM PRINT PALETTE AND MENU
      DEF PROCdrawmenu
      FOR count%=1 TO 7
        PRINTTAB(count%*2-2,0) CHR$(128+count%);CHR$(255+(count%=curcol%)*213);
      NEXT count%
      PRINTTAB(14,0) CHR$(135);"PD2 CKB ORLF E LS U A<>PS"
      ENDPROC
Last edited by FourthStone on Mon Aug 10, 2020 8:35 am, edited 2 times in total.

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Sun Aug 09, 2020 11:24 pm

Gosh thank you so much Fourthstone. You got done in a weekend what takes me weeks. I will have a play. Great. 😁

User avatar
FourthStone
Posts: 998
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Teletext paint program

Post by FourthStone » Mon Aug 10, 2020 12:31 am

Sorry I think I posted the wrong code!

Will fix shortly :oops:

EDIT: Fixed! Apologies must have pasted the old version somehow, please see above post for latest version.

EDIT2: Have updated the code with additional tools, see above!

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Mon Aug 10, 2020 8:55 am

Oh wow that is just awesome! Almost all the tools are done! Thanks so much! Wow. =D>
I can do some pictures this week.It feels very nice to use now.
The line draws properly. The fill works first time. I am sure all the teletext artists will be using this.

Sorry there are more suggestions...I am never happy am I Fourthstone! :lol:

1) Paint with colour - so when you paint it blobs a character colour in front of shape. Also paint with background colour to set paper. I do like the thing you did btw when you select a colour you start drawing in that colour. We need to be able to paint colours on screen like a paintpot.
2) Reverse dither - so you can shade a filled in shape ( like an eraser that is dithered)
3) Load and Save. Wanted to try to avoid typing in anything on an Ipad so it saves with a random filename and you get an indication it has saved. Save checks filename hasn't been used before so won't overwrite anything.
4) Animation - when switched on when you paint and let go after you have painted it automatically goes to the next frame. The <> go through the frames. Save just saves all the frames in one go with random filenames. Play and Stop. Shows you which number frame you are on.
5) Template. If you draw a screen you could save it as a template. It then gets copied to all the frames somehow on pushing a button. That means you could paint a background and then animate over the top of it. Otherwise it means drawing in colours for every frame which is impossible
6) Copy and paste would be nice.
7) Like in ART4ever it would be so nice to draw animated lines and circles that span over frames. So maybe you draw your pic and then when you click 'render' or something it draws all the other frames in.

I have to say though even without this it is marvellous. Thank you so much. It really is amazing and 'The Book of Planets' can be done now. That is going to be cool I can tell you! :)
Last edited by pixelblip on Mon Aug 10, 2020 10:19 pm, edited 3 times in total.

Soruk
Posts: 793
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Teletext paint program

Post by Soruk » Mon Aug 10, 2020 9:16 am

pixelblip wrote:
Mon Aug 10, 2020 8:55 am
3) Load and Save. Wanted to try to avoid typing in anything on an Ipad so it saves with a random filename and you get an indication it has saved. Save checks filename hasn't been used before so won't overwrite anything.
I would suggest a timestamp instead of a random name, it would be easier to find which was which and unless you save more than once a second there is automatically no risk of overwriting anything.
Matrix Brandy BASIC VI (work in progress)

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Mon Aug 10, 2020 9:17 am

Thanks Soruk that is great advice.

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Mon Aug 10, 2020 9:31 am

The tools feel so nice and natural (and smooth). The dithering is awesome.
Attachments
Paint.PNG

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Mon Aug 10, 2020 3:19 pm

It doesn’t get better than this. Sitting in the sun on my own whilst everyone else is at work whilst I am painting teletext on my IPad!! :D
A few days ago that was not possible!!
Attachments
4BDD7B13-0065-4B00-8A14-ED291C8A5552.jpeg

User avatar
pixelblip
Posts: 2062
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: Teletext paint program

Post by pixelblip » Mon Aug 10, 2020 3:35 pm

Thanks everyone so far (from the park!) :D
Attachments
155C0B16-355C-480A-959B-741BBD641C3F.jpeg

Post Reply

Return to “programming”