michael
Full Member
member is offline


Posts: 157
|
 |
RETROLIB 10 + REFERENCE MOD OCT 22 2017
« Thread started on: Dec 31st, 2016, 03:07am » |
|
RETROLIB 10 and the new reference text file and a tree link:
https://1drv.ms/f/s!AmYwmTjbmULXlAOzlJftEz2Pqgv-
Note: RETROLIB 10 can be separated into a standalone library, as long as you INSTALL @lib$+"COMLIBA" at the beginning of your program and also INSTALL "RETROLIB 10" after other demo code has been removed
OCTOBER 22, 2017:
** ADDED commands
FNabutton(x,y,size%,c$,com$) - creates a mouse interactive box at x,y setup each button like this: res$=FNabutton(100,100,25,"green","fill") - creates the 25x25 box fills with green (to set up before use) after setup - IF FNabutton(100,100,25,"green","clicked")="clicked" THEN PRINT "you clicked on the box" "clicked" is sent to FNabutton and if you click in the 25x25 area it checks, it returns "clicked" to the user.
PROCarrowu(x,y) and PROCarrowd(x,y) -creates simple arrows for up or down at x,y using active foreground color
**********************************************
Eyes have been improved. Thanks to Zaphod and Richard for their help
NEW !! FNgkey tool added to RETROLIB A tool to check common game keys and return a string description for assessment snippet: Code: REM game key checker DEFFNgkey LOCAL rk$ IF INKEY(-66) THEN rk$="A" IF INKEY(-82) THEN rk$="S" IF INKEY(-51) THEN rk$="D" IF INKEY(-34) THEN rk$="W" IF INKEY(-74) THEN rk$="ENTER" IF INKEY(-99) THEN rk$="SPACE" IF INKEY(-26) THEN rk$="LEFT" IF INKEY(-122) THEN rk$="RIGHT" IF INKEY(-58) THEN rk$="UP" IF INKEY(-42) THEN rk$="DOWN" =rk$
UPDATE : new tool added: this snippet wont work without the rest of the library example: PROCslate(x%,y%,size%,r%,g%,b%) Code:PROCslate(100,100,200,200,200,255) procedure Code: REM NEW shaded edged block DEFPROCslate(x%,y%,size%,r%,g%,b%) LOCAL cun%,r$,g$,b$,cd% FOR cun%=120 TO 0 STEP-11 PROCcrgb(r%-cun%,g%-cun%,b%-cun%) PROCrect(x%+cd%,y%+cd%,x%+size%-cd%,y%+size%-cd%) cd%+=1 NEXT cun% r$=FNnumstr(r%):g$=FNnumstr(g%):b$=FNnumstr(b%) PROCpaint(x%+cd%+1,y%+cd%+1,r$+","+g$+","+b$) ENDPROC
SAMPLE code of the new color controls "string based for string uses"
PROCbcolor("color name or number") -set a background color PROCfcolor("color name or number") -set a foreground color Code: PROCgraphics(1000,600) REM set background color to core color 2 (green) PROCbcolor("green") CLG PROCfcolor("yellow") CIRCLE FILL 500,500,100 PROCset(300,300,"light white") MOVE 0,0 END REM SET c$ can be colors like blue or 1 ... NOTE SET is modified for this example.. IN RETROLIB 6, it can accept RRR,GGG,BBB values REM GRAPHICS(x,y) DEF PROCgraphics(x,y) VDU 23,22,x;y;8,15,16,1 OFF VDU 5 ENDPROC DEF PROCset(x%,y%,c$) LOCAL h% PROCfcolor(c$) FOR h%=0 TO 20 LINE x%+h%,y%,x%+h%,y%+20 NEXT MOVE 0,0 ENDPROC REM restore default color palettes DEFPROCresetrgb COLOUR 0,0,0,0 :COLOUR 1,200,0,0 :COLOUR 2,000,200,000 COLOUR 3,200,200,000:COLOUR 4,000,000,200:COLOUR 5,200,000,200 COLOUR 6,000,200,200:COLOUR 7,200,200,200:COLOUR 8,056,056,056 COLOUR 9,248,056,056:COLOUR 10,056,248,056:COLOUR 11,248,248,056 COLOUR 12,056,056,248:COLOUR 13,248,056,248:COLOUR 14,056,248,248 COLOUR 15,248,248,248 ENDPROC DEFFNstcorecol(wdnum$) PROCresetrgb LOCAL tcol% CASE wdnum$ OF WHEN "0","black" :tcol%=0 WHEN "1","red" :tcol%=1 WHEN "2","green" :tcol%=2 WHEN "3","yellow" :tcol%=3 WHEN "4","blue" :tcol%=4 WHEN "5","magneta" :tcol%=5 WHEN "6","cyan":tcol%=6 WHEN "7","white":tcol%=7 WHEN "8","grey":tcol%=8 WHEN "9","light red":tcol%=9 WHEN "10","light green":tcol%=10 WHEN "11","light yellow":tcol%=11 WHEN "12","light blue":tcol%=12 WHEN "13","light magneta":tcol%=13 WHEN "14","light cyan":tcol%=14 WHEN "15","light white" :tcol%=15 ENDCASE =tcol% DEF PROCfcolor(co$) LOCAL rcol% rcol%=FNstcorecol(co$) GCOL rcol% ENDPROC DEF PROCbcolor(co$) LOCAL rcol% rcol%=FNstcorecol(co$) GCOL 128 +rcol% ENDPROC
|
| « Last Edit: Oct 22nd, 2017, 11:39pm by michael » |
Logged
|
I like reinventing the wheel, but for now I will work on tools for D3D
|
|
|