BBC BASIC for Windows
« The evil replacement window »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:58pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: The evil replacement window  (Read 197 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
wink The evil replacement window
« Thread started on: Mar 21st, 2016, 03:06am »

Code:
      
MODE 8
      COLOUR 1,100,100,100 REM Set palette color 1 to RGB triplet (my custom text background color)
      GCOL 0 : REM Set graphics foreground to palette color 0  (BLACK)
      GCOL 128+1 : REM Set graphics background to palette color 1
      VDU 5 : REM Treat text as graphics (transparent background)
      OFF
      CLG
      initialx%=0
      PROCborder(10,305,560,620,21,225,225,225,10)
      PROC_pr(22,985,7,1,"THE REPLACEMENT WINDOW",200,200,200)
      PROC_pr(520,985,1,15,"X  ",200,50,50)
      PROC_pr(50,700,1,2,"Nooooooo!!",150,150,3)
      MOVE 0,0 REM move the > out of view
      WAIT 0
      END
      DEF PROCborder(x%, y%, dx%, dy%, wide%, r%, g%, b%, grade%)
      LOCAL midx%, midy%, I%
      midx%=x%+wide%/2
      midy%=y%+wide%/2
      FOR I% =1 TO wide%/2
        PROC_color("f",r%,g%,b%)
  
        RECTANGLE midx%-I%,midy%-I%, dx%+2*I%, dy%+2*I%
        RECTANGLE midx%+I%,midy%+I%, dx%-2*I%, dy%-2*I%
        r%-=grade%
        g%-=grade%
        b%-=grade%
        IF r%<2 THEN r%=2
        IF g%<2 THEN g%=2
        IF b%<2 THEN b%=2
      NEXT
      ENDPROC

      REM X,Y,text color,boarder color,message,r,g,b
      DEF PROC_pr(X,Y,C,CT,msg$,r,g,b)
      initialx%=LEN(msg$)
      COLOUR 0,r,g,b
      GCOL 0
      LET tx= X+initialx%+25
      LET ty= Y
      initialx%=initialx%*22
      FOR fill=1 TO 58
        LINE X+3,Y+20-fill,X+initialx%,Y+20-fill
      NEXT fill
      GCOL CT
      MOVE tx,ty
      PRINT msg$
      GCOL C
      LINE X,Y+20,X+initialx%,Y+20
      LINE X,Y+20,X,Y-40
      LINE X,Y-40,X+initialx%,Y-40
      LINE X+initialx%,Y-40,X+initialx%,Y+20
      LINE X-5,Y+25,X+initialx%+5,Y+25
      LINE X-5,Y+25, X-5,Y-45
      LINE X+initialx%+5,Y+25,X+initialx%+5,Y-45
      LINE X-5,Y-45,X+initialx%+5,Y-45
      MOVE 0,0 REM hide that thing

      ENDPROC

      DEF PROC_color(fb$,r,g,b)
      IF fb$="f" OR fb$="F" THEN COLOUR 0,r,g,b : GCOL 0
      IF fb$="b" OR fb$="B" THEN COLOUR 1,r,g,b : GCOL 128+1
      ENDPROC
 
« Last Edit: Mar 21st, 2016, 03:12am by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls