From a78b12d75005a719d8fb8d838137f7a763601eb4 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 11 Feb 2024 01:09:56 -0800 Subject: [PATCH] fix centering and clipping no idea why I need some of these offsets but whatever --- monogram.p8 | 13 +++++++++++++ vacation.p8 | 51 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/monogram.p8 b/monogram.p8 index af89b0d..d2c9253 100644 --- a/monogram.p8 +++ b/monogram.p8 @@ -11,6 +11,13 @@ print("\feMONOGRAM") print("\n\f7SLICK MONOSPACE FONT") print("BY vINICIUS mENEZIO") print("\nNOW ON \fcpico-8\f7!") +print("the quick brown fox") +print("jumps over a lazy dog") +print("THE QUICK BROUN FOX") +print("JUMPS OVER A LAZY DOG") +print("aIN'T PUNCTUATION") +print("UH, UM... somethin'?") + -->8 -- monogram - A FREE FONT -- BY vINICIUS mENEZIO @@ -44,3 +51,9 @@ __map__ 0f11110f010101000e111111150916000f11110f111111000e11010e10110e001f040404040404001111111111110e0011111111110a040011111111151b110011110a040a11110011110a04040404001f10080402011f000804040204040800040404000404040004080810080804000000120d000000000000000000000000 1f1f1f1f1f1f1f00150a150a150a150000111f15150e00000e1f111b0e110e00110411041104110002061e0e0f0c0800000e13131f170e00001b1f1f0e04000004110e1b1b0e1104000e0e001f0e0a0000040e1f151d00000e1b191b0e110e00000e1f151f110e00040c1414040703000e1115110e110e0000040e1b0e040000 00000015000000000e1b131b0e110e000000041f0e1b00001f110a040a111f000e1b111f0e110e00000502001408000008150200081502000e151b150e110e001f001f001f001f001515151515151500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +1e083c1106000000100c020c10000000227a2222120000001e2000023c000000083c10020c000000020202221c000000083e080c08000000123f12021c0000003c107e043800000002073202320000000f020e101c0000003e404020180000003e10080810000000083804023c00000032071278180000007a42020a72000000 +093e4b6d660000001a272273320000003c4a494946000000123a123a1a000000236222221c0000000c00082a4d000000000c1221400000007d79113d5d0000003e3c081e2e00000006247e2610000000244e04463c0000000a3c5a46300000001e041e4438000000143e2408080000003a56523008000000041c041e06000000 +08023e201c00000022222620180000003e1824723000000004362c26640000003e182442300000001a272223120000000e641c28780000000402062b1900000000000e1008000000000a1f120400000000040f150d00000000040c060e0000003e2014040200000030080e0808000000083e2220180000003e0808083e000000 +107e181412000000043e242232000000083e083e080000003c24221008000000047c1210080000003e2020203e000000247e242010000000062026100c0000003e20101826000000043e240438000000222420100c0000003e222d300c0000001c083e08040000002a2a20100c0000001c003e080400000004041c2404000000 +083e080804000000001c00003e0000003e2028102c000000083e305e08000000202020100e0000001024244442000000021e02021c0000003e2020100c0000000c12214000000000083e082a2a0000003e201408100000003c003e001e000000080424427e00000040281068060000001e041e043c000000043e240404000000 +1c1010103e0000001e101e101e0000003e003e201800000024242420100000001414145432000000020222120e0000003e2222223e0000003e2220100c0000003e203c2018000000062020100e000000001510080600000000041e140400000000000c081e000000001c18101c00000008046310080000000810630408000000 diff --git a/vacation.p8 b/vacation.p8 index 6afc6f9..39d2b71 100644 --- a/vacation.p8 +++ b/vacation.p8 @@ -196,7 +196,7 @@ end view = { x=0, y=0, - w=128, + w=255, h=128, } mknew(view, function(x) @@ -691,7 +691,8 @@ zonk_mode = { files={}, lnh = 9, --space width - spc_w = 2, + spc_w = 0, + spc_full=6, --text mode txmd=0x81, --text spring-in distance @@ -730,13 +731,19 @@ function zonk_mode:g(_, fn, ...) return _ENV[fn](...) end function zonk_mode:at(_, x, y) + --i don't know why i need the + --spc_full offset but i do self.txt_frame=scootbox.new{ - x=x, - from=y, - to=y-self.exmg, + x=x-self.spc_full, + from=y-5, + to=y-5-self.exmg, frames=self.exf, } end +function zonk_mode:center(_, rows, cols) + local w,h = cols*self.spc_full, rows*self.lnh-1 + self:at(_, 64-ceil(w/2), 64-ceil(h/2)) +end function zonk_mode:bon() self.brth.on=true self.brth.off_soon=false @@ -788,7 +795,7 @@ function zonk_mode:next_item() self.line = nil self.expect_cfg_line = true self.cx = 0 - self.cy = 0 + self.cy = 5 return 0, nil end self.line = split(line, " ") @@ -803,10 +810,11 @@ function zonk_mode:next_item() local token = tostr(del(self.line, 1)) while #token == 0 and #self.line > 0 do -- emit extra spaces - self.cx += 1 + self.spc_w + self.cx += self.spc_full token = tostr(deli(self.line, 1)) end local pp,cmult=nrm_txt_pal,1 + if (token[1]==">") token,self.cx=sub(token,2),self.cx+self.spc_full\2 if (token[1]=="$") token,cmult=sub(token,2),2 if (token[1]=="^") token,cmult=sub(token,2),0.5 if (token[1]=="!") token,pp=sub(token,2),sfd_txt_pal @@ -896,6 +904,7 @@ function zonk_mode:draw() self.txt_frame:draw() -- TODO: draw throbber if not self.playing_text and not self.confirmed and self.twt <= 0 then + font_default() print("➡️",121,121,12) print("➡️",120,120,self:throbber_color()) end @@ -903,7 +912,7 @@ function zonk_mode:draw() end function zonk_mode:throbber_color() - if (not self.bwt) return ((t()<<1)&0x1 < 1) and 7 or 6 + if (not self.bwt or self.bwt==0) return ((t()<<1)&0x1 < 1) and 7 or 6 return self.brth:matches(self.bwt) and 7 or 6 end @@ -964,7 +973,7 @@ function ao_splash:draw() self.c:draw() if self.fwait < ao_splash.fwait then print("18+", 55, 60, 7) - print("aDULTS ONLY", 35, 90, 15) + print("aDULTS ONLY", 30, 90, 15) end if (self.d) self.d:draw() end @@ -1548,11 +1557,11 @@ function start_game() { f=zonk_mode.new, params={{ - file=[[at:2:55 -hI! iN A LATER VERSION -THERE WILL BE ACTUAL -INSTRUCTIONS HERE AND -THE BG WON'T BE ON.]], + file=[[center:4:20 +wELCOME! iN A LATER +VERSION, THERE WILL +BE INSTRUCTIONS HERE +AND NO BG yet.]], txd=0, txf=1, cmul=0.25, @@ -1567,23 +1576,23 @@ THE BG WON'T BE ON.]], { f = zonk_mode.new, params={{ - file=[[at:40:40 + file=[[center:5:14 ZONK TEXT TEST #ZONK TEXT #TEST $ZONK $TEXT $TEST !ZONK !TEXT !TEST ^ZONK ^TEXT ^TEST ----- -at:30:60 bon bpal:1 set:confirmed:true set:bwt:1 set:txf:2 set:txd:0 set:exd:0 set:exf:10 +center:1:13 bon bpal:1 set:confirmed:true set:bwt:1 set:txf:2 set:txd:0 set:exd:0 set:exf:10 bREATHE IN... ----- -at:28:60 set:confirmed:true set:bwt:2 bpal:2 +center:1:14 set:confirmed:true set:bwt:2 bpal:2 bREATHE OUT... ----- -set:bwt:0 set:txd:16 set:txf:20 set:exf:60 at:1:55 -gREAT! iT'S LIKE YOU'VE - BEEN DOING THIS YOUR - ENTIRE LIFE. +set:bwt:0 set:txd:16 set:txf:20 set:exf:60 center:3:19 + >gREAT! iT'S LIKE + YOU'VE BEEN DOING +THIS ALL YOUR LIFE. ]], }}, },