This editor version works. Somehow. It is possible to load, save and write a file with the switches for astrolog.as which can be pasted at the end of this file. With < enter> one comes to editor from there with <tab> to the upper and back and with <enter> again to choice. Movement with yellow color is invisible, press <V> to draw visible and <T> to take drawing into array. Some keys are not implemented now. <Esc> ends. Or <Ctrl + C> at any point to immediate end.
Code: Select all
' glyph-string editor.bas
' edit glyph-strings for astrolog 6.30 and others in FreeBASIC
#include "fbgfx.bi"
using fb
screenres 1115, 888, 4,, GFX_ALWAYS_ON_TOP ' 16 colors
windowtitle "Glyph-String Editor v 0.1 for astrolog 6.30 and others"
type box
x as integer
y as integer
aktiv as short
end type
dim shared as box small(9,9),big(17,17)
dim shared as integer sx,sy,ox,oy,ux,uy,lx,ly,visible,nomove
dim shared as integer i,c1,c2,c3,x,y,onr,nr,zahl,speed,outside,p
dim shared as string smallglyph, bigglyph, glyph(109), names(54), help(54)
dim shared as string g,gold,gnew,g2,gold2,gnew2
dim shared as any ptr buffer(109)
speed=1600 ' adjust speed here if needed
declare sub showglyphs
declare sub loadglyphs
declare sub saveglyphs
declare sub writeswitch
declare sub upper
declare sub editor
declare sub showbig
declare sub showsmall
declare sub moverect
' original definitions from data.cpp
' ******************************************************************************
' ** Global Tables.
' ******************************************************************************
names(00)="Aries"
names(01)="Taurus"
names(02)="Gemini"
names(03)="Cancer"
names(04)="Leo"
names(05)="Virgo"
names(06)="Libra"
names(07)="Scorpio"
names(08)="Sagittarius"
names(09)="Capricorn"
names(10)="Aquarius"
names(11)="Pisces"
names(12)="Earth"
names(13)="Sun"
names(14)="Moon"
names(15)="Mercury"
names(16)="Venus"
names(17)="Mars"
names(18)="Jupiter"
names(19)="Saturn"
names(20)="Uranus"
names(21)="Neptune"
names(22)="Pluto"
names(23)="Chiron"
names(24)="Ceres"
names(25)="Pallas"
names(26)="Juno"
names(27)="Vesta"
names(28)="North Node"
names(29)="South Node"
names(30)="Lilith"
names(31)="Fortune"
names(32)="Vertex"
names(33)="East Point"
names(34)="Ascendant"
names(35)="2nd Cusp"
names(36)="3rd Cusp"
names(37)="Nadir" ' mistake, not the same like imum coeli
names(38)="5th Cusp"
names(39)="6th Cusp"
names(40)="Descendant"
names(41)="8th Cusp"
names(42)="9th Cusp"
names(43)="Midheaven" ' better call it medium coeli, it's not zenit
names(44)="11th Cusp"
names(45)="12th Cusp"
names(46)="Vulcan"
names(47)="Cupido"
names(48)="Hades"
names(49)="Zeus"
names(50)="Kronos"
names(51)="Apollon"
names(52)="Admetos"
names(53)="Vulkanus"
names(54)="Poseidon"
' original definitions from xdata.cpp
' ******************************************************************************
' ** Graphics Table Data.
' ******************************************************************************
' doubled defineds taken out here
' small signs
glyph(00)="ND4HU2HLGDFBR6EUHLGD2G" '/* Aries */
glyph(01)="BL3D2F2R2E2U2H2NE2L2NH2G2" '/* Taurus */
glyph(02)="BLU3LHBR7GLNL3D6NL3RFBL7ERU3" '/* Gemini */
glyph(03)="BFNDERFDGLNHGL2HLHBU3NEDFREUHNLER2FRF"'/* Cancer */
glyph(04)="BF4H2UEU2H2L2G2D2FDGH" '/* Leo */
glyph(05)="BF4BLH2U3E2D5G2BU5U2HGND6HGND6H" '/* Virgo */
glyph(06)="BGNL3HUER2FDGR3BD2L8" '/* Libra */
glyph(07)="BH4FND6EFND6EFD6FREU" '/* Scorpio */
glyph(08)="BG4E3NH2NF2E5NL2D2" '/* Sagittarius */
glyph(09)="BH3BLED4FND2EU2EUFNDERFDGLNHF2D2G" '/* Capricorn #1 */
glyph(10)="BG4EUEDFDEUEDFDEUEBU5GDGUHUGDGUHUGDG" '/* Aquarius */
glyph(11)="NL4NR4BH4F2D4G2BR8H2U4E2" '/* Pisces */
' small planets
glyph(12)="ND4NL4NR4U4LGLDGD2FDRFR2ERUEU2HULHL" '/* Earth */
glyph(13)="U0BH3DGD2FDRFR2ERUEU2HULHL2GL" '/* Sun */
glyph(14)="BG3E2U2H2ER2FRDFD2GDLGL2H" '/* Moon */
glyph(15)="BD4UNL2NR2U2REU2HNEL2NHGD2FR" '/* Mercury */
glyph(16)="LHU2ER2FD2GLD2NL2NR2D2" '/* Venus */
glyph(17)="HLG2DF2RE2UHE4ND2L2" '/* Mars */
glyph(18)="BH3RFDGDGDR5NDNR2U6E" '/* Jupiter */
glyph(19)="BH3R2NUNR2D4ND2E2RFDGDF" '/* Saturn */
glyph(20)="BD4NEHURBFULU3NUNR2L2NU2DGBU5NFBR6GD3F"'/* Uranus #1 */
glyph(21)="BD4U2NL2NR2U5NUNRLBL2NUNLDF2R2E2UNRU" '/* Neptune */
glyph(22)="D2NL2NR2D2BU8GFEHBL3D2F2R2E2U2" '/* Pluto #1 */
glyph(23)="BG2LDFEULU3NURFRFBU5GLGLU2" '/* Chiron */
glyph(24)="BD4UNL3NR3U2RE2UH2L2G" '/* Ceres */
glyph(25)="BD4UNL3NR3UE2HUHNUGDGF2" '/* Pallas Athena */
glyph(26)="BD4UNL2NR2U4NL4NR4NE3NF3NG3NH3U3" '/* Juno */
glyph(27)="BU4DBG3NLFDF2E2UERBH2GDGHUH" '/* Vesta */
glyph(28)="BG2LGFEU2HU2E2R2F2D2GD2FEHL" '/* North Node */
glyph(29)="BH2LHEFD2GD2F2R2E2U2HU2EFGL" '/* South Node */
glyph(30)="BG4E8BG2FD2G2L2H2U2E2R2F" '/* Lilith #1 */
glyph(31)="NE2NF2NG2H2GD2F2R2E2U2H2L2G" '/* Part of Fortune */
glyph(32)="U2NHNEBD4NGNFU2L2NHNGR4NEF" '/* Vertex */
glyph(33)="BH4NR3D4NR2D4R3BR2U8R2FD2GL2" '/* East Point */
glyph(34)="BG4U4NR2U3EFD7BR2NURU2HU2RDBR3ULD5RU" '/* Ascendant */
glyph(35)="BH3ER4FD2GLGLG2DR6" '/* 2nd Cusp */
glyph(36)="BH3ER4FD2GNL3FD2GL4H" '/* 3rd Cusp */
glyph(37)="BH4R2NR2D8NL2R2BR4NUL2U8R2D" '/* Nadir */
glyph(38)="BG3FR4EU2HL5U4R6" '/* 5th Cusp */
glyph(39)="BE3HL4GD6FR4EU2HL4G" '/* 6th Cusp */
glyph(40)="BH4D8REU6HLBF7DRU2HU2RDBG4NRU3NRU2R" '/* Descendant */
glyph(41)="BL2GD2FR4EU2HNL4EU2HL4GD2F" '/* 8th Cusp */
glyph(42)="BG3FR4EU6HL4GD2FR4E" '/* 9th Cusp */
glyph(43)="BG4U8F2ND6E2D8BR4NUL2U8R2D" '/* Midheaven */
glyph(44)="BH3ED8NLRBR2RNRU8G" '/* 11th Cusp */
glyph(45)="BG4RNRU8GBR4ER2FD2GLG2D2R4" '/* 12th Cusp */
glyph(46)="NU4D4NH3E3" '/* Vulcan */
glyph(47)="BH4BRFDG2DR8BG3UNL2NR2U5LUEFDL" '/* Cupido */
glyph(48)="BENUNL2NR2D3ND2NR2L2H2U2E2R4" '/* Hades */
glyph(49)="BU4NG2NF2D7NDBLHLBR6LGL2GLBR6LHL" '/* Zeus */
glyph(50)="BU2D3ND3NR2L2BH2UE2R4F2D" '/* Kronos */
glyph(51)="U3NLR2NRD3NL2NR2D4NRL2NLU4L4UEUH" '/* Apollon */
glyph(52)="BUNU2NL2NR2D2ND3LHU2ENHR2NEFD2GL" '/* Admetos */
glyph(53)="G2DGR6HUH2U4NG2F2" '/* Vulcanus */
glyph(54)="ND4U4BL3DF2R2E2UBD8UH2L2G2D" '/* Poseidon */
' big signs
glyph(55)="BD8U7HU3HU2H2L2G2D2F2BR12E2U2H2L2G2D2GD3G" '/* Aries */
glyph(56)="BH6BU2FDFRFNR4GLGDGD4FDFRFR4EREUEU4HUHLHEREUE" '/* Taurus */
glyph(57)="BL2U6LHLHBR14GLGLNL6D12NL6RFRFBL14ERERU6" '/* Gemini */
glyph(58)="BF5NLRE2U2H2L2G2D2F2G2L4HL2H3BE6NH2D2G2L2H2U2E2R2E2R4FR2F3" '/* Cancer */
glyph(59)="BF8H4U2E2U4HUHLHL4GLGDGD4FDFD2GL2HU" '/* Leo */
glyph(60)="BF8BL2H3UHU5E4D9GDG3BU10U4H2G2ND12H2G2ND12H2" '/* Virgo */
glyph(61)="" '/* Libra */
glyph(62)="BH8F2ND12E2F2ND12E2F2D12F2RE2U3NGF" '/* Scorpio */
glyph(63)="" '/* Sagittarius */
glyph(64)="BH6BL2E2D4FD4FND4EU2EUEU2EUF2ND2E2R2F2D2G2L2NH2F4D4G2" '/* Capricorn #1 */
glyph(65)="BG8EUE2UEDFD2FDEUE2UEDFD2FDEUE2UEBU10GDG2DGUHU2HUGDG2DGUHU2HUGDG2DG" '/* Aquarius */
glyph(66)="NL8NR8BH8F3DFD6GDG3BR16H3UHU6EUE3" '/* Pisces */
' big planets
glyph(67)="ND8NL8NR8U8L2GLG3DGD4FDF3RFR4ERE3UEU4HUH3LHL2" '/* Earth */
glyph(68)="U0BU8L2GLG3DGD4FDF3RFR4ERE3UEU4HUH3LHL2" '/* Sun */
glyph(69)="BG6E3UEU2HUH3E2R4FRF3DFD4GDG3LGL4H2" '/* Moon */
glyph(70)="" '/* Mercury */
glyph(71)="" '/* Venus */
glyph(72)="BELHL4G3D4F3R4E3U4HUE7ND5L5" '/* Mars */
glyph(73)="BH6BRRF2D2GDGDGDGDR10ND2NR4U12E2" '/* Jupiter */
glyph(74)="" '/* Saturn */
glyph(75)="BD4LGD2FR2EU2HLU6NU2NR4L4NU4D2G2BU10NF2BR12G2D6F2" '/* Uranus #1 */
glyph(76)="BD8U4NL4NR4U10NU2NR2L2BL3LNU2NLD2FDFRFR4EREUEU2NLNRU2" '/* Neptune */
glyph(77)="D4NL4NR4D4BU16LGD2FR2EU2HLBL6D4FDFRFR4EREUEU4" '/* Pluto #1 */
glyph(78)="BG4LGD2FR2EU2HLU7RF2RF2RFBU10GLG2LG2BLU5" '/* Chiron */
glyph(79)="BD8U2NL6NR6U4R3E3U4H3L4G2" '/* Ceres */
glyph(80)="BD8U2NL6NR6U2E4HUHUHUHNUGDGDGDGF4" '/* Pallas Athena */
glyph(81)="BD8U2NL4NR4U8NL7NR7NE5NF5NG5NH5U6" '/* Juno */
glyph(82)="BU8D3BG5NL3DF2DF2DFEUE2UE2UR3BH4GDG2DGHUH2UH" '/* Vesta */
glyph(83)="BG4BDHL2GD2FR2EU5H2U4E4R4F4D4G2D5FR2EU2HL2G" '/* North Node */
glyph(84)="BH4BUGL2HU2ER2FD5G2D4F4R4E4U4H2U5ER2FD2GL2H" '/* South Node */
glyph(85)="" '/* Lilith #1 */
glyph(86)="" '/* Part of Fortune */
glyph(87)="" '/* Vertex */
glyph(88)="" '/* East Point */
glyph(89)="BG8U8NR4U6E2F2D14BR4NHREU3HLHU3ERFBR6HLGD8FRE" '/* Ascendant */
glyph(90)="" '/* 2nd Cusp */
glyph(91)="" '/* 3rd Cusp */
glyph(92)="BH8R4NR4D16NL4R4BR8BUNUGL3HU14ER3FD" '/* Nadir */
glyph(93)="" '/* 5th Cusp */
glyph(94)="" '/* 6th Cusp */
glyph(95)="BH8D16R2E2U12H2L2BF14BGFREU3HLHU3ERFBG9NR3U5NR3U5R3" '/* Descendant */
glyph(96)="" '/* 8th Cusp */
glyph(97)="" '/* 9th Cusp */
glyph(98)="BG8U16F4ND12E4D16BR8BUNUGL3HU14ER3FD" '/* Midheaven */
glyph(99)="" '/* 11th Cusp */
glyph(100)="" '/* 12th Cusp */
glyph(101)="" '/* Vulcan */
glyph(102)="BH8BR2F2D2G2DG2DR16BG6U2NL4NR4U10LHU2ER2FD2GL" '/* Cupido */
glyph(103)="" '/* Hades */
glyph(104)="BU8NG4NF4D14ND2BLHL2HLBR12LGL2GL2GL2GLBR12LHL2HL" '/* Zeus */
glyph(105)="" '/* Kronos */
glyph(106)="U6NL2R4NR2D6NL4NR4D8NR2L4NL2U8L8UE2U3H2" '/* Apollon */
glyph(107)="" '/* Admetos */
glyph(108)="G2DG2DG2R12H2UH2UH2U8NG4F4" '/* Vulcanus */
glyph(109)="" '/* Poseidon */
' help
help(00)=""
help(01)="Choice Mode:"
help(02)=""
help(03)="<Up> Up"
help(04)="<Down> Down"
help(05)="<Left> Left"
help(06)="<Right> Right"
help(07)="<Enter> Edit"
help(08)=""
help(09)="<1> Color 1 "
help(10)="<2> Color 2"
help(11)="<3> Color 3"
help(12)="<4> Color 4"
help(13)=""
help(14)=""
help(15)=""
help(16)=""
help(17)="<L> Load Glyphs"
help(18)="<S> Save Glyphs"
help(19)="<W> Write Switches"
help(20)=""
help(21)="<Esc> Exit"
help(22)=""
help(23)=""
help(24)=""
help(25)=""
help(26)="Edit Mode:"
help(27)=""
help(28)="<Tab> Upper/Lower"
help(29)=""
help(30)="<Up> Up"
help(31)="<Down> Down"
help(32)="<Left> Left"
help(33)="<Right> Right"
help(34)="<E> NE"
help(35)="<F> SE"
help(36)="<G> SW"
help(37)="<H> NW"
help(38)=""
help(39)=""
help(40)=""
help(41)=""
help(42)="<C> Clear"
help(43)=""
help(44)="<U> Undo"
help(45)=""
help(46)="<T> Take in Array"
help(47)="<V> Visible"
help(48)="<N> Nomove"
help(49)=""
help(50)=""
help(51)=""
help(52)="<Enter> Back"
help(53)=""
help(54)="<Ctrl+C> Hot Seat"
' create editor coords and show
ox=425
oy=190
line(215,170) - step (640,620),6,bf ' draw backbox
for sx = 1 to 9
for sy = 1 to 9
small(sx,sy).x = ox + sx * 20
small(sx,sy).y = oy + sy * 20
next sy
next sx
ox=345
oy+=200
for sx = 1 to 17
for sy = 1 to 17
big(sx,sy).x = ox + sx * 20
big(sx,sy).y = oy + sy * 20
next sy
next sx
'ox=90
'oy=10
for sx = 1 to 9
for sy = 1 to 9
with small(sx,sy)
if .aktiv = 1 then
line(.x,.y) - step (18,18),1,bf
else
line(.x,.y) - step (18,18),15,bf
end if
end with
next sy
next sx
'ox=10
'oy+=210
for sx = 1 to 17
for sy = 1 to 17
with big(sx,sy)
if .aktiv = 1 then
line(.x,.y) - step (18,18),1,bf
else
line(.x,.y) - step (18,18),15,bf
end if
end with
next sy
next sx
sub showglyphs
color 15,0
' show small glyphs
for x = 0 to 54
i = x '+ 1
buffer(i) = imagecreate(9, 9, 2)
draw buffer(i), "bm4,4" & glyph(i) ' set cursor to center and add glyph
put (14 + 20 * x, 10), buffer(i), pset
next x
' show big glyphs
for x = 0 to 54
i = x + 55
buffer(i) = imagecreate(17, 17, 2)
draw buffer(i), "bm8,8" & glyph(i) ' set cursor to center and add glyph
put (10 + 20 * x, 30), buffer(i), pset
next x
' show names
color 15,0
for i = 0 to 54
draw string (50, 120 + i*13), names(i)
next i
' show help
for i = 0 to 54
draw string ( 920, 120 + i*13), help(i)
next i
' show small glyph string
color 0,0
line(10,80) - step (1094,14),15,bf
draw string (14,84), smallglyph ' draw small glyph-string
' show big glyph string
line(10,852) - step (1094,14),15,bf ' erase background
draw string (14,856), bigglyph ' draw big glyph-string
end sub
sub loadglyphs ' open and read the file
dim as integer filehandle
filehandle = freefile
open "glyphs.txt" for input as #filehandle
for i = 0 to 109
line input #filehandle, glyph(i)
next i
close #filehandle
showglyphs
end sub
sub saveglyphs ' open and write the file
dim as integer filehandle
filehandle = freefile
open "glyphs.txt" for output as #filehandle
for i = 0 to 109
print #filehandle, glyph(i)
next i
close #filehandle
end sub
sub writeswitch ' open and write the file with switches
dim as integer filehandle
dim as string zeile
filehandle = freefile
open "astroglyphs.txt" for output as #filehandle
print #filehandle, ""
print #filehandle, "; IMPORTANT! If you make redefinitions of the Uranians below please uncheck"
print #filehandle, "; Uranians in 'SETTING/INCLUDE URANIANS' before 'VIEW/SHOW INTERPRETATIONS'."
print #filehandle, ";The new names would be shown with the old texts of the Uranians! IMPORTANT!"
print #filehandle, ""
print #filehandle, "; Paste at the end of astrolog.as."
print #filehandle, "; ----------------------------------------------------------------------------"
print #filehandle,""
for i = 0 to 54 ' write switches
zeile = "-yxd " & names(i) & " " & chr(34) & glyph(i) & chr(34) & " " & chr(34) & glyph(i+55) & chr(34)
print #filehandle, zeile
next i
close #filehandle
end sub
sub upper
ux=5:uy=5:visible=0
do
sleep speed ' adjust speed here if needed
if multikey(SC_CONTROL)and (multikey(SC_c) or multikey(SC_C)) then end ' hot seat
if multikey(SC_1) then c3 += 1
if multikey(SC_left) then ux -= 1 :p=1:g="L"
if multikey(SC_right) then ux += 1 :p=1:g="R"
if multikey(SC_up) then uy -= 1 :p=1:g="U"
if multikey(SC_down) then uy += 1 :p=1:g="D"
if multikey(SC_PAGEUP) or multikey(SC_g) then ux += 1:uy-=1:p=1:g="G"
if multikey(SC_PAGEDOWN) or multikey(SC_h) then ux += 1:uy+=1:p=1:g="H"
if multikey(SC_END) or multikey(SC_f) then ux -= 1:uy+=1:p=1:g="F"
if multikey(SC_HOME) or multikey(SC_e) then ux -= 1:uy-=1:p=1:g="E"
if ux < 1 then ux = 1 :outside=1
if ux > 9 then ux = 9 :outside=1
if uy < 1 then uy = 1 :outside=1
if uy > 9 then uy = 9 :outside=1
if (p=1 and outside=0) then showsmall
p=0:outside=0
if c3 > 6 then c3 = 1
' clear
if multikey(SC_C) or multikey(SC_c)then
for x = 0 to 8
for y = 0 to 8
with small(x+1,y+1)
.aktiv = 0
line(.x,.y) - step (18,18),15,bf
end with
next y
next x
smallglyph = ""
showsmall
visible=0:ux=5:uy=5
end if
' take into array
if multikey(SC_t) or multikey(SC_T) then
glyph(nr+0) = smallglyph
imagedestroy(buffer(nr+0)) ' clear
buffer(nr+0) = imagecreate(9, 9, 2)
color 15,2
draw buffer(nr+0), "bm4,4" & glyph(nr+0) ' set cursor to center and add glyph
put (14 + 20 * (nr), 10), buffer(nr+0), pset
color c3,15
end if
' visible
if multikey(SC_v) or multikey(SC_v)then
if visible = 1 then
visible = 0
draw string (10, 10), "visible",0
else
visible = 1
draw string (10, 10), "visible",15
end if
end if
' draw small box
with small(ux,uy)
if visible = 1 then
.aktiv = 1
if .aktiv = 1 then
line(.x,.y) - step (18,18),c3,bf
'else
'line(.x,.y) - step (18,18),1,bf
end if
else
if .aktiv = 0 then
line(.x,.y) - step (18,18),14,bf,00010001
else
line(.x,.y) - step (18,18),c3,bf
end if
end if
end with
showsmall
loop until multikey(SC_tab) 'inkey = chr(13) ' until enter pressed
end sub
ox=325
oy=190
sub showsmall ' make glyph-string
color 0,0
if visible = 0 then ' invisible?
if left(gold,1) = "B" then
if mid(gold,2,1) = g then ' same direction
if len(gold) = 4 then
zahl=val(right(gold,2)) ' old number 2 digit
elseif len(gold) = 3 then
zahl=val(right(gold,1)) ' old number 1 digit
else
zahl=1 ' old number 0 digit
end if
smallglyph = rtrim (smallglyph,gold)
gold = "B" & g & str(zahl+1)
if gold = "B0" then gold = ""
smallglyph += gold ' new bigglyph
else ' another direction)
gold = "B" & g
smallglyph += gold ' new bigglyph
end if
else ' invisible, no B
gold = "B" & g
smallglyph += gold ' new bigglyph
end if
else ' visible
if left(gold,1) = "B" then ' previous B
gold = g ' new direction
smallglyph += gold ' new bigglyph
else ' visible
if mid(gold,1,1) = g then ' same direction
if len(gold) = 3 then
zahl=val(right(gold,2))
elseif len(gold) = 2 then
zahl=val(right(gold,1))
else
zahl=1
end if
smallglyph = rtrim (smallglyph,gold)
gold = g & str(zahl+1)
smallglyph += gold ' new bigglyph
else ' new direction
gold = g
smallglyph += gold ' new bigglyph
end if
end if
end if ' make glyph-string
line(10,80) - step (1094,14),15,bf ' erase backgrund
draw string (14,84), smallglyph ' draw small glyph-string
end sub
gold = "B00"
bigglyph=""
sub showbig
color 0,0
' make glyph-string
if visible = 0 then ' invisible?
if left(gold,1) = "B" then
if mid(gold,2,1) = g then ' same direction
if len(gold) = 4 then
zahl=val(right(gold,2)) ' old number 2 digit
elseif len(gold) = 3 then
zahl=val(right(gold,1)) ' old number 1 digit
else
zahl=1 ' old number 0 digit
end if
bigglyph = rtrim (bigglyph,gold)
gold = "B" & g & str(zahl+1)
if gold = "B0" then gold = ""
bigglyph += gold ' new bigglyph
else ' another direction)
gold = "B" & g
bigglyph += gold ' new bigglyph
end if
else ' invisible, no B
gold = "B" & g
bigglyph += gold ' new bigglyph
end if
else ' visible
if left(gold,1) = "B" then ' previous B
' bigglyph = rtrim (bigglyph,gold)
gold = g ' new direction
bigglyph += gold ' new bigglyph
else ' visible
if mid(gold,1,1) = g then ' same direction
if len(gold) = 3 then
zahl=val(right(gold,2))
elseif len(gold) = 2 then
zahl=val(right(gold,1))
else
zahl=1
end if
bigglyph = rtrim (bigglyph,gold)
gold = g & str(zahl+1)
bigglyph += gold ' new bigglyph
else ' new direction
'trim (bigglyph,gold)
gold = g
bigglyph += gold ' new bigglyph
end if
end if
end if ' make glyph-string
line(10,852) - step (1094,14),15,bf ' erase background
draw string (14,856), bigglyph ' draw big glyph-string
end sub
sub editor
smallglyph = ""
bigglyph = ""
for x = 0 to 8
for y = 0 to 8
if point(x,y,buffer(nr)) = 15 then
small(x+1,y+1).aktiv = 1
else
small(x+1,y+1).aktiv = 0
end if
next y
next x
for x = 0 to 16
for y = 0 to 16
if point(x,y,buffer(nr+55)) = 15 then
big(x+1,y+1).aktiv =1
else
big(x+1,y+1).aktiv = 0
end if
next y
next x
ox=90
oy=10
for sx = 1 to 9
for sy = 1 to 9
with small(sx,sy)
if .aktiv = 1 then
line(.x,.y) - step (18,18),1,bf
else
line(.x,.y) - step (18,18),15,bf
end if
end with
next sy
next sx
ox=10
oy+=210
for sx = 1 to 17
for sy = 1 to 17
with big(sx,sy)
if .aktiv = 1 then
line(.x,.y) - step (18,18),1,bf
else
line(.x,.y) - step (18,18),15,bf
end if
end with
next sy
next sx
draw string (215,170-16), "visible",0
draw string (315,170-16), "nomove",0
draw string (715,170-16), "smallglyph",0:draw string (715,170-16), "bigglyph",15
'nr=0
visible=0
nomove=0
lx=9
ly=9
c1=1
c2=1
c3=1
do
sleep speed ' adjust speed here if needed
' clear
if multikey(SC_c) or multikey(SC_C) then
for x = 0 to 16
for y = 0 to 16
with big(x+1,y+1)
.aktiv = 0
line(.x,.y) - step (18,18),15,bf
end with
next y
next x
visible = 0: draw string (215,170-16), "visible",0
lx=9:ly=9
bigglyph = ""
gold="B00"
g=""
line(10,852) - step (1094,14),15,bf ' erase background
'showbig
end if
' upper
if multikey(SC_TAB) then draw string (715,170-16), "bigglyph",0:draw string (715,170-16), "smallglyph",15:upper
' visible
if multikey(SC_v) or multikey(SC_V)then
if visible = 0 then
visible = 1
draw string (215,170-16), "visible",15
else
visible = 0
draw string (215,170-16), "visible",0
end if
end if
' nomove
if multikey(SC_n) or multikey(SC_N)then
if nomove = 0 then
nomove = 1
draw string (315,170-16), "nomove",15
else
nomove = 0
draw string (315,170-16), "nomove",0
end if
end if
' color
if multikey(SC_3) then c3+=1 ' color 3
' take into array
if multikey(SC_t) or multikey(SC_T) then
glyph(nr+55) = bigglyph
imagedestroy(buffer(nr+55)) ' clear
buffer(nr+55) = imagecreate(17, 17, 2)
color 15,2
draw buffer(nr+55), "bm8,8" & glyph(nr+55) ' set cursor to center and add glyph
put (10 + 20 * (nr), 30), buffer(nr+55), pset
color c3,15
end if
' cursor (numpad)
if multikey(SC_CONTROL)and (multikey(SC_c) or multikey(SC_C)) then end ' hot seat
if multikey(SC_PAGEUP) or multikey(SC_g) then lx+=1:ly-=1:p=1:g="G"
if multikey(SC_PAGEDOWN) or multikey(SC_h) then lx+=1:ly+=1:p=1:g="H"
if multikey(SC_END) or multikey(SC_f) then lx-=1:ly+=1:p=1:g="F"
if multikey(SC_HOME) or multikey(SC_e) then lx-=1:ly-=1:p=1:g="E"
if multikey(SC_LEFT) then lx-=1 :p=1:g="L"
if multikey(SC_RIGHT) then lx+=1 :p=1:g="R"
if multikey(SC_UP) then ly-=1 :p=1:g="U"
if multikey(SC_DOWN) then ly+=1 :p=1:g="D"
if lx < 1 then lx=1 :outside=1
if lx > 17 then lx=17:outside=1
if ly < 1 then ly=1 :outside=1
if ly > 17 then ly=17:outside=1
if (p=1 and outside=0) then showbig
p=0:outside=0
if c3 > 6 then c3 = 1
with big(lx,ly)
if visible = 1 then
.aktiv = 1
' if .aktiv = 1 then
line(.x,.y) - step (18,18),c3,bf
'else
'line(.x,.y) - step (18,18),1,bf
'end if
else
if .aktiv = 0 then
line(.x,.y) - step (18,18),14,bf
else
line(.x,.y) - step (18,18),7,bf 'light grey
end if
end if
end with
loop until multikey(SC_ENTER) 'until "enter" pressed
end sub
sub moverect
if nr > 54 then nr = 0
if nr < 0 then nr = 54
line(9+20*onr,6) - step (19,44),0,b ' erase last frame
line(9+20*nr,6) - step (19,44),12,b ' glyph red frame
line(50,120+13*onr) - step (86,8),0,b ' erase last frame
line(50,120+13*nr) - step (86,8),12,b ' name red frame
onr=nr
end sub
dim as event ptr event
event = allocate(20)
' mainloop
showglyphs
do
sleep speed ' adjust speed here if needed
if multikey(SC_CONTROL)and (multikey(SC_c) or multikey(SC_C)) then end ' hot seat
if multikey(SC_LEFT) or multikey(SC_UP) then nr-=1
if multikey(SC_RIGHT) or multikey(SC_DOWN) then nr+=1
if multikey(SC_L) or multikey(SC_l) then loadglyphs
if multikey(SC_S) or multikey(SC_s) then saveglyphs
if multikey(SC_W) or multikey(SC_w) then writeswitch
if multikey(SC_ENTER) then editor
moverect
loop until multikey(SC_ESCAPE) ' until esc pressed
for i = 0 to 109
imagedestroy buffer(i)
next i
end ' Glyph-String Editor
Problems are in the subs "showsmall" and "showbig". I believe i have taken a completely false approach there. Who can do better?