#Whiteboard

1 messages · Page 1 of 1 (latest)

autumn heart
#

trying to make an interactive whiteboard for a 2D game im making. My best idea for now is to just have a part serve as a whiteboard and use spheres to serve as strokes, however this creates a few problems (optimisation, how do i make buckets???, etc etc) So im curious to see if anyone has any better ideas, or if not help me walk through the process.

#

purely using camera manip for transitions and stuff

autumn heart
#

genuinely though how do i do bucket

#

i have a general idea of everything else honestly

#

my only idea for bucket is ricocheting raycasts

#

but thats just

#

terrible

autumn heart
#

please i need bucket fill ideas

zealous geode
autumn heart
#

holy shit

zealous geode
#

What

hollow rune
#

you can use a flood fill for bucket tool

#

or just store the spheres in a table so you can flood fill

autumn heart
autumn heart
hollow rune
#

where table[x][y] is true or false depending on if theres a sphere

#

and then for floodfill you just.. do a floodfill algorithm

autumn heart
hollow rune
#

its like

autumn heart
hollow rune
#

basically you start at a cel and check all cells around that

#

and then repeat for those cells

#

and so on

autumn heart
#

i see

#

do i really need to use tables for that

#

seems like something like raycast would work

hollow rune
#

but then you would be doing hundreds of raycasts vs hundreds of table checks

#

i guess you could use raycasts but i only use them rarely

autumn heart
#

optimisation issue im guessing?

#

im just not sure how to use the table method really

hollow rune
#

umm

#

yeah good point

#

you would have to map out the mouse position on the whiteboard to a x y coordinate and then set table[x][y] to 1 (or a color3 if you want colors)

#

idk do whatever suits you

autumn heart
#

i think i'll do the raycast method

#

thanks for telling me about the flood fill method though much appreciated <3