Section One BBS

Welcome, Guest.


Subject: Another Frame.js question Date: Thu Jun 11 2015 12:53 am
From: echicken To: Kirkman

  Re: Another Frame.js question
  By: Kirkman to All on Tue Jun 09 2015 15:29:46

 Ki> - If the frame needs a new tile, .load() it, then .draw()

 Ki> When I .load() a new ANS or BIN file into a frame, does Frame.js just
 Ki> replace all data and redraw every character in the entire frame? Or does

I'd have to check to be sure, but I suspect this is the case.

 Ki> it check the new data against the old data to see if there are characters
 Ki> it can skip repainting?

The .load() process will slow things down somewhat, and I think that .draw()
will force a total redraw of the frame.  This is probably where a good chunk of
the slowness is coming from.

How many different kinds of tiles are there?  If each is saved as an individual
.bin or .ans, you might try combining them all into a single spritesheet.  Load
the entire spritesheet into each 16x16 frame, then scroll the frame to
different x/y offsets as needed to reveal the desired portion of the larger
graphic.  This would cut out the .load() and .draw() calls, as .cycle() (which
I assume is being called regularly on the overall parent frame) should take
care of redrawing all child frames as needed.

---
echicken
electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
 ■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com

Previous Message       Next Message
In Reply To: Another Frame.js question (Kirkman)
Replies: Another Frame.js question (Kirkman)