...
 
Commits (4)
......@@ -116,16 +116,8 @@ tbox.setparam 1 texbottomedge 36
tbox.setparam 1 bevel 0
// 2: Dialogue title box
tbox.setloc 2 5200,24000
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
tbox.reset 2
tbox.setparam 2 snaptoanchorx 3200
tbox.setparam 2 textcolor 0x204F
tbox.setparam 2 basecolor0 0xDDDF
tbox.setparam 2 basecolor1 0xEEEA
......@@ -153,6 +145,7 @@ tbox.setparam 3 texbottomedge 39
tbox.setparam 3 bevel 0
// 4: Highlight box
tbox.reset 4
tbox.setparam 4 paddingleft 300
tbox.setparam 4 paddingright 300
tbox.setparam 4 paddingtop 80
......
......@@ -8,8 +8,6 @@ viewport.setparams viewport:1 parent:0, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setparams viewport:2 parent:1, ratiox 480 ratioy 296
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 1
// Textbox setup
tbox.setnumboxes 4
......@@ -23,26 +21,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ===== the title screen =====
gfx.show SANSI bkg
......
......@@ -7,8 +7,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 280
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 2
#gfx.show TENFRE bkg viewport 1
#gfx.show TENGO_NO viewport 1
......@@ -25,26 +23,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ===== title =====
......
......@@ -7,8 +7,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 280
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 2
// 480x280 view in 640x400 frame @ 80,20
#sys.viewport 4096, 1638; 24576 x 22938
......@@ -25,26 +23,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ===== title screen =====
......
......@@ -8,8 +8,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 296
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 1
#gfx.show FRE55 bkg viewport 1
......@@ -25,26 +23,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ===== title screen =====
......
......@@ -9,8 +9,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 296
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 2
#gfx.show FROFRE bkg viewport 1
#gfx.show PUSH viewport 1
......@@ -29,26 +27,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ===== title screen =====
......
......@@ -9,8 +9,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 296
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 2
#gfx.show slot 0 FREMI2
#gfx.show slot 1 JURA
......@@ -29,26 +27,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// Show the Tiare logo before the title screen?
//gfx.show bkg TIARE_S
......
......@@ -84,22 +84,12 @@ tbox.setparam 1 bevel 0
tbox.setparam 1 autowaitkey 1
// 2: Dialogue title box
tbox.setloc 2 4800,25000
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 paddingtop 240
tbox.setparam 2 paddingbottom 240
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
tbox.reset 2
tbox.setparam 2 textcolor 0xFFFF
tbox.setparam 2 basecolor0 0x000D
tbox.setparam 2 basecolor1 0x220C
tbox.setparam 2 basecolor2 0x110B
tbox.setparam 2 basecolor3 0x330A
tbox.setparam 2 bevel 1
// 3: Choice box
tbox.setloc 3 600,20000 ay:30000
......@@ -120,13 +110,8 @@ tbox.setparam 3 textopedge 14
tbox.setparam 3 texbottomedge 13
tbox.setparam 3 bevel 0
// 4: Highlight box
tbox.setparam 4 paddingleft 220
tbox.setparam 4 paddingright 220
tbox.setparam 4 paddingtop 80
tbox.setparam 4 paddingbottom 80
tbox.setparam 4 bevel 1
tbox.setparam 4 basecolor 0xFFF7
// 4: Highlight box (default)
tbox.reset 4
goto MT_0101.
......
......@@ -9,8 +9,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 296
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 1
// Textbox setup
tbox.setnumboxes 4
......@@ -24,26 +22,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
gfx.show OP_013 bkg
gfx.transition 4
......
......@@ -119,24 +119,11 @@ tbox.decorate 1 MAINBOXDECORRIGHT x 32768 y 0 anchorx 32768 anchory 0
tbox.setparam 1 autowaitkey 1
// 2: Dialogue title box
tbox.setloc 2 4800,26000
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 600
tbox.setparam 2 paddingright 600
tbox.setparam 2 snaptobox 1
tbox.reset 2
tbox.setparam 2 basecolor 0x7ADC
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 120
tbox.setparam 3 paddingbottom 120
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
goto CS101.
......
......@@ -9,8 +9,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 296
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 1
#gfx.show FREFRE bkg viewport 1
......@@ -26,26 +24,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ===== the title screen =====
......
......@@ -8,8 +8,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 496, ratioy = 255
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 2
#gfx.show T_KABE bkg viewport 1
// 496x255 view in 640x400 frame @ 80,16
......@@ -27,26 +25,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// Title screen
......
......@@ -7,8 +7,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 296
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 6
#gfx.show FRERINR bkg viewport 1
// 480x296 view in 640x400 frame @ 16,16
......@@ -26,26 +24,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ==================================================================
......
......@@ -4,12 +4,10 @@ tbox.setnumboxes 5
choice.columns 2
// 3: Choice box
tbox.setloc 3 16384,8800 ax:16384
tbox.setparam 3 maxrows 99
tbox.setparam 3 minsizex 18000
tbox.setparam 3 maxsizex 18000
tbox.setparam 3 lx 16384
tbox.setparam 3 ly 8800
tbox.setparam 3 ax 16384
tbox.setparam 3 margintop 768
tbox.setparam 3 marginbottom 768
......@@ -20,6 +18,7 @@ tbox.setparam 3 bevel 0
tbox.setlanguage 3 $defaultlang
// 4: Highlight box
tbox.reset 4
tbox.setparam 4 bevel 0
tbox.setparam 4 basecolor 0xFFF7
tbox.setparam 4 negatebkg 1
......
......@@ -9,8 +9,6 @@ viewport.setparams viewport:1 parent:0, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setparams viewport:2 parent:1, ratiox 480 ratioy 296
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 1
tbox.setlanguage 0 $defaultlang
......@@ -60,24 +58,15 @@ choice.setpartbox 3
choice.setchoicebox 3
choice.sethighlightbox 4
choice.columns 1
tbox.reset
tbox.setlanguage 1 $defaultlang
tbox.setlanguage 2 $defaultlang
tbox.setlanguage 3 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// Intro
// 2: Dialogue title box (default)
// ===== Intro =====
waitkey
call INTRO.
......@@ -87,11 +76,9 @@ tbox.reset 3
tbox.reset 4
// 3: Choice box
tbox.setloc 3 600,20000 ay:30000
tbox.setparam 3 maxrows 10
tbox.setparam 3 mincols 6
tbox.setparam 3 lx 600
tbox.setparam 3 ly 20000
tbox.setparam 3 ay 30000
tbox.setparam 3 paddingtop 950
tbox.setparam 3 paddingbottom 950
tbox.setparam 3 paddingleft 999
......@@ -106,13 +93,7 @@ tbox.setparam 3 textopedge 14
tbox.setparam 3 texbottomedge 13
tbox.setparam 3 bevel 0
// 4: Highlight box
tbox.setparam 4 paddingleft 320
tbox.setparam 4 paddingright 320
tbox.setparam 4 paddingtop 120
tbox.setparam 4 paddingbottom 120
tbox.setparam 4 bevel 1
tbox.setparam 4 basecolor 0xFFF7
// 4: Highlight box (default)
#gfx.show slot 0 TENK11
......
......@@ -8,8 +8,6 @@ viewport.setparams viewport:1 parent:0, ratiox = 480, ratioy = 296
viewport.setparams viewport:2 parent:1, locx 0 locy 0 sizex 32768 sizey 32768
viewport.setdefault 2 // all game graphics will go in viewport 2
viewport.setbkgindex viewport:1 index 0
viewport.setbkgindex viewport:2 index 1
// Textbox setup
tbox.setnumboxes 4
......@@ -23,26 +21,12 @@ tbox.setlanguage 0 $defaultlang
// 1: Game text & choice box
tbox.setlanguage 1 $defaultlang
// 2: Dialogue title box
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 12
tbox.setparam 2 lx 4800
tbox.setparam 2 ly 25000
tbox.setparam 2 paddingtop 256
tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
// 2: Dialogue title box (default)
tbox.reset 2
tbox.setlanguage 2 $defaultlang
// 3: Highlight box
tbox.setparam 3 paddingleft 320
tbox.setparam 3 paddingright 320
tbox.setparam 3 paddingtop 80
tbox.setparam 3 paddingbottom 80
tbox.setparam 3 bevel 1
tbox.setparam 3 basecolor 0xFFF7
// 3: Highlight box (default)
tbox.reset 3
// ===== title screen =====
gfx.show VOP_002 bkg y -32768
......
......@@ -69,7 +69,7 @@ tbox.setparam 1 autowaitkey 1
tbox.setparam 1 bevel 0
// 2: Dialogue title box
tbox.setloc 2 7200,25000 ax:10000
tbox.setloc 2 ay:32768
tbox.setparam 2 minrows 1
tbox.setparam 2 maxrows 1
tbox.setparam 2 mincols 8
......@@ -78,6 +78,7 @@ tbox.setparam 2 paddingbottom 256
tbox.setparam 2 paddingleft 512
tbox.setparam 2 paddingright 512
tbox.setparam 2 snaptobox 1
tbox.setparam 2 snaptoanchorx 4000
tbox.setparam 2 basecolor 0x47E8
tbox.setparam 2 basefill 0
tbox.settexture 2 TEXTBOX2 normal normal
......
......@@ -33,8 +33,8 @@ print 5 .."---"
tbox.setnumboxes 10
tbox.setloc 6 9200,13900 ax:32768
tbox.setloc 7 17000 10000 ay:32768
tbox.setloc 8 26000 20000
tbox.setloc 7 17000 10000 ax:32768 ay:32768
tbox.setloc 8 26000 20000 ay:32768
tbox.setloc 9 9000 28000
print 6 "6 Snap right"
print 7 "7 Snap down"
......@@ -48,8 +48,12 @@ tbox.setparam 9 textalign 1
waitkey noclear=1
tbox.setparam 6 snaptobox 5
tbox.setparam 7 snaptobox 5
tbox.setparam 7 snaptoanchorx 32768
tbox.setparam 8 snaptobox 5
tbox.setparam 8 snaptoanchorx 32768
tbox.setparam 8 snaptoanchory 32768
tbox.setparam 9 snaptobox 5
tbox.setparam 9 snaptoanchory 32768
waitkey noclear=1
tbox.setparam 6 snaptobox
tbox.setparam 7 snaptobox
......@@ -149,17 +153,20 @@ tbox.popout 6
waitkey noclear=1
tbox.clear 1
tbox.setnumboxes 8
tbox.setparam 1 poptype 0
tbox.setparam 6 poptype 0
tbox.clear 6
tbox.setparam 6 minsizex 14000
tbox.setparam 6 minsizey 1600
tbox.setparam 6 maxsizey 6400
tbox.setparam 7 snaptobox 6
print "Transition 0, instant. With movement and sizing!\n"
print "Instant, linear, coscos and halfcos."
print 6 "Box McBoxFace"
print 7 "oh snap"
waitkey noclear=1
tbox.setloc 6 locx 12000 locy 4000 time 3200 style=instant
......@@ -179,6 +186,7 @@ tbox.setsize 6 sizex 9000 sizey 5600 time 3200 style=halfcos
sleep
tbox.clear 1
tbox.setnumboxes 7
tbox.reset 6
print "Done!"
waitkey noclear=1
......
......@@ -121,7 +121,7 @@ var i : dword;
setlength(scrollbar, boxSizeP_r.h);
// Add the up and down arrows, or = if unscrollable.
c := style.scrollbar.capColor;
scrollbar[0].ccolor := (Rendermatic.palette[c.r shr 4][c.g shr 4][c.b shr 4].color1) + backpal shl 4;
scrollbar[0].ccolor := (Rendermatic.palette[c.r shr 4][c.g shr 4][c.b shr 4].flatcolor) + backpal shl 4;
if contentWinScrollOfsP > 0 then
scrollbar[0].ccode := chr($E2) + chr($86) + chr($91)
else
......@@ -134,7 +134,7 @@ var i : dword;
// Add the trough, using a checkerboard block.
c := style.scrollbar.troughColor;
dword(c) := (Rendermatic.palette[c.r shr 4][c.g shr 4][c.b shr 4].color1) + backpal shl 4;
dword(c) := (Rendermatic.palette[c.r shr 4][c.g shr 4][c.b shr 4].flatcolor) + backpal shl 4;
sy := boxSizeP_r.h - 2;
while sy <> 0 do begin
scrollbar[sy].ccolor := dword(c);
......@@ -147,7 +147,7 @@ var i : dword;
sy := contentFullHeightP - contentWinSizeP.h;
sy := ((boxSizeP_r.h - 3) * contentWinScrollOfsP + sy shr 1) div sy + 1;
c := style.scrollbar.thumbColor;
scrollbar[sy].ccolor := (Rendermatic.palette[c.r shr 4][c.g shr 4][c.b shr 4].color1) shl 4 + backpal;
scrollbar[sy].ccolor := (Rendermatic.palette[c.r shr 4][c.g shr 4][c.b shr 4].flatcolor) shl 4 + backpal;
scrollbar[sy].ccode := ' ';
end;
......
......@@ -81,11 +81,11 @@ type TTextBox = class
// Total box pixel size = content window size + padding + margins.
boxSizeP : TSizeP;
// If non-zero, this box's pixel location, below, is snapped to be pixel-perfectly attached to the closest edge of the
// snap-to box. A box can't snap to itself, and no box can snap to 0. The snap edges are specifically the padded box
// borders, not counting any additional box margins.
// If non-zero, this box's anchor location is snapped pixer-perfectly to the snap anchor of the snapToBox. This overrides
// the box's boxLoc.xy temporarily. A box can't snap to itself, and no box can snap to the null box so 0 means no snap.
// The snap edges are specifically the padded box borders, not not counting any additional box margins.
snapToBox : dword;
{$note todo: add snap to anchor in target box}
snapToAnchor : TCoord32k;
// 32k coordinates of anchor point within the padded box (less margins). 0,0 aligns the box by its top left corner, 32k,32k
// by its bottom right. A perfectly centered box of any size would have a 16k,16k anchor, at viewport coordinates 16k,16k.
......@@ -269,7 +269,7 @@ type TTextBox = class
procedure Clear;
procedure Scroll(scrollp : longint; msecs : longint = -1; movetype : EMoveType = MT_HALFCOS; owningfiber : longint = -1);
procedure Hide(makehidden : boolean);
procedure Snap(tobox : dword);
procedure Snap;
procedure GetNewFont(heightp : dword);
procedure FlowContent;
procedure PrintFast(srcp : pointer; srclen : dword);
......
......@@ -108,7 +108,8 @@ begin
boxInViewport := 0;
lineHeightP := 0;
anchor.x := 0; anchor.y := 0; boxLoc.x := 0; boxLoc.y := 0;
snapToBox := 0; boxLanguage := 0; exportToBox := 0;
snapToBox := 0; snapToAnchor.x := 0; snapToAnchor.y := 0;
boxLanguage := 0; exportToBox := 0;
content.caretPos := -1;
parametersNeedUpdate := TRUE;
......@@ -156,8 +157,7 @@ begin
style.autoVanish := FALSE;
end
else if boxIndex = 1 then begin
// Default game text box.
else if boxIndex = gamevar.defaultTextbox then begin
boxLoc.x := 16384; boxLoc.y := 32000;
anchor.x := 16384; anchor.y := 32768;
padding.left := 1024;
......@@ -170,12 +170,23 @@ begin
style.autoWaitkey := TRUE;
end
else if boxIndex in [2,3] then begin
// One of these is probably the choice highlight box.
padding.left := 320;
padding.right := 320;
padding.top := 80;
padding.bottom := 80;
else if boxIndex = gamevar.dialogueTitleBox then begin
padding.left := 600;
padding.right := 600;
padding.top := 210;
padding.bottom := 210;
anchor.y := 32768;
snapToBox := gamevar.defaultTextbox;
snapToAnchor.x := 2000;
contentWinMinRows := 1; contentWinMaxRows := 1;
contentWinMinCols := 11;
end
else if boxIndex = choicematic.highlightBox then begin
padding.left := 310;
padding.right := 310;
padding.top := 90;
padding.bottom := 90;
dword(style.baseColor[0]) := $77FFFFFF;
dword(style.baseColor[1]) := $77FFFFFF;
dword(style.baseColor[2]) := $77FFFFFF;
......@@ -316,56 +327,35 @@ begin
TEffectBoxScroll.Create(owningfiber, msecs, boxIndex, scrollp, movetype);
end;
procedure TTextBox.Snap(tobox : dword);
// Snaps the rendering location of this box pixel-perfectly to the padded box edge of its defined snapto-neighbor.
procedure TTextBox.Snap;
// Sets the rendering location of this box pixel-perfectly to the snap anchor relative to the padded size of its snapto-target.
// You should only ever snap to lower-numbered boxes, or you risk lagging the snapto-neighbor's position by one frame.
// Avoid snapping any box to box 0, since that has various special handling.
var ownlocp, neighborlocp : TEdgeCoordP;
dist : TEdgeSizeP;
// You can't snap to box 0.
var ownlocp : TEdgeCoordP;
targetboxlocp : TCoordP;
targetboxsizep : TSizeP;
begin
if (tobox >= length(BoxHub.textbox)) then begin
LogError('bad snap-to box: ' + strdec(tobox));
if (snapToBox = 0) or (snapToBox >= length(BoxHub.textbox)) then begin
LogError('bad snap-to box: ' + strdec(snapToBox));
exit;
end;
ownlocp.left := boxLoc.xp + longint(margin.leftp);
ownlocp.top := boxLoc.yp + longint(margin.topp);
ownlocp.right := boxLoc.xp + longint(boxSizeP.w) - margin.rightp;
ownlocp.bottom := boxLoc.yp + longint(boxSizeP.h) - margin.bottomp;
with BoxHub.textbox[tobox] do begin
neighborlocp.left := boxLoc.xp + longint(margin.leftp);
neighborlocp.top := boxLoc.yp + longint(margin.topp);
neighborlocp.right := boxLoc.xp + longint(boxSizeP.w) - margin.rightp;
neighborlocp.bottom := boxLoc.yp + longint(boxSizeP.h) - margin.bottomp;
with BoxHub.textbox[snapToBox] do begin
targetboxlocp.x := boxLoc.xp + longint(margin.leftp);
targetboxlocp.y := boxLoc.yp + longint(margin.topp);
targetboxsizep.w := boxSizeP.w - margin.leftp - margin.rightp;
targetboxsizep.h := boxSizeP.h - margin.topp - margin.bottomp;
end;
dist.left := high(dword); dist.right := high(dword); dist.top := high(dword); dist.bottom := high(dword);
if snapToAnchor.x >= 0 then
boxLoc.xp := targetboxlocp.x + (targetboxsizep.w * snapToAnchor.x + 16384) shr 15
else
boxLoc.xp := targetboxlocp.x - (-(targetboxsizep.w * snapToAnchor.x + 16384)) shr 15;
// Test top and bottom snap distance if boxes' x areas overlap.
if (ownlocp.left <= neighborlocp.right) and (ownlocp.right >= neighborlocp.left) then begin
dist.top := abs(ownlocp.bottom - neighborlocp.top);
dist.bottom := abs(neighborlocp.bottom - ownlocp.top);
end;
// Test left and right snap distance if boxes' y areas overlap.
if (ownlocp.top <= neighborlocp.bottom) and (ownlocp.bottom >= neighborlocp.top) then begin
dist.left := abs(ownlocp.right - neighborlocp.left);
dist.right := abs(neighborlocp.right - ownlocp.left);
end;
{log(strcat('Snap box % -> %: ownlocp %,%-%,%; neilocp %,%-%,%; dL=&, dT=&, dR=&, dB=&',
[boxIndex, tobox, ownlocp.left, ownlocp.top, ownlocp.right, ownlocp.bottom,
neighborlocp.left, neighborlocp.top, neighborlocp.right, neighborlocp.bottom,
longint(dist.left), longint(dist.top), longint(dist.right), longint(dist.bottom)]));}
// Snap to whichever edge is closest.
if (dist.top <= dist.left) and (dist.top <= dist.right) and (dist.top <= dist.bottom) then
boxLoc.yp := neighborlocp.top - boxSizeP.h + margin.bottomp
else if (dist.right <= dist.left) and (dist.right <= dist.bottom) then
boxLoc.xp := neighborlocp.right - margin.leftp
else if (dist.bottom <= dist.left) then
boxLoc.yp := neighborlocp.bottom - margin.topp
else if (dist.left <> high(dword)) then
boxLoc.xp := neighborlocp.left - boxSizeP.w + margin.rightp;
if snapToAnchor.y >= 0 then
boxLoc.yp := targetboxlocp.y + (targetboxsizep.h * snapToAnchor.y + 16384) shr 15
else
boxLoc.yp := targetboxlocp.y - (-(targetboxsizep.h * snapToAnchor.y + 16384)) shr 15;
end;
procedure TTextBox.GetNewFont(heightp : dword);
......@@ -857,22 +847,26 @@ end;
procedure TTextBox.SetLocation(x, y, anchorx, anchory : longint);
// Sets a box immediately to a new 32k location, relative to its viewport. Also updates its pixel location, relative to the
// game window. If temporary is TRUE, calculates using the _r variables instead of permanent ones.
// game window.
var paddedboxsizep : TSizeP;
begin
boxLoc.x := x; anchor.x := anchorx;
boxLoc.y := y; anchor.y := anchory;
boxLoc.DerivePixelsFrom32k(viewport[boxInViewport].viewportSizeP);
inc(boxLoc.xp, viewport[boxInViewport].viewportLoc.leftp);
inc(boxLoc.yp, viewport[boxInViewport].viewportLoc.topp);
if snapToBox <> 0 then
Snap
else begin
boxLoc.DerivePixelsFrom32k(viewport[boxInViewport].viewportSizeP);
inc(boxLoc.xp, viewport[boxInViewport].viewportLoc.leftp);
inc(boxLoc.yp, viewport[boxInViewport].viewportLoc.topp);
end;
// Apply own anchor.
paddedboxsizep.w := boxSizeP.w - margin.leftp - margin.rightp;
paddedboxsizep.h := boxSizeP.h - margin.topp - margin.bottomp;
dec(boxLoc.xp, margin.leftp + (paddedboxsizep.w * anchor.x + 16384) shr 15);
dec(boxLoc.yp, margin.topp + (paddedboxsizep.h * anchor.y + 16384) shr 15);
if (snapToBox <> 0) then Snap(snapToBox);
boxNeedsRedraw := TRUE;
end;
......@@ -1012,6 +1006,8 @@ begin
{$endif}
'snaptobox': snapToBox := _MinMaxDefault(0, boxIndex - 1);
'snaptoanchorx': snapToAnchor.x := _MinMaxDefault(low(longint), high(longint));
'snaptoanchory': snapToAnchor.y := _MinMaxDefault(low(longint), high(longint));
'exporttobox': exportToBox := _MinMaxDefault(0, 99999);
'textcolor': dword(style.textColor) := ExpandColorRef(_MinMaxDefault(0, $FFFF));
'basecolor': begin
......