#Drawing placement with preview code

1 messages · Page 1 of 1 (latest)

topaz osprey
#

@leaden sandal

#

((it has a stupid typo in the class name >.< ))

leaden sandal
#

Okay, this is pretty awesome! Thank you. Out of curiosity, what did you need to edit in the class?

topaz osprey
#

i basically copied the entire thing

#

then changed what it extended, Drawing instead of MeasuredTemplate

#

I removed some references to items

#

this.#events.resolve(canvas.scene.createEmbeddedDocuments("Drawing", [this.document.toObject()])); and that line had "MeasuredTemplate" and not "Drawing"

#

the fromData method was fromItem, so i changed that name

#

and removed item stuff there

#

that is basically it

#

you can compare both codes next to eachother

leaden sandal
#

All right, didn’t seem to be too complicated, actually 😅

topaz osprey
#

i left the rotate method in, but i dont think it does anything

#

it wasnt or i couldnt have done it

leaden sandal
#

Don’t sell yourself short. I was just taking a quick look and thought it’s too complicated for what I’m doing, but you’ve just made it a 1000 times more awesome

topaz osprey
#

so if you put this in a module or world script, all your macros can use it

#

if you global it

leaden sandal
#

Yeah, I was actually thinking about making it a module

topaz osprey
#

might need some tweaking on the data end

#

also atm it is snapped to the grid

#

all kinds of things you might want to change

leaden sandal
#

I was just creating a way to quickly set up some sticky notes, and the more I work on it, the more I think it might be useful for others. With the preview, it might just be cool enough to share it.

#

In case I’ll actually make it a public module, how do you like to be credited?

topaz osprey
#

yeah seems like a fun little idea for a module

#

not needed 🙂

leaden sandal
#

I’ll do it anyway 😛

#

Credit where it’s due

topaz osprey
#

the 5e system

leaden sandal
#

All right, then

#

Thank you anyway!

topaz osprey
#

you are far from done

#

if you want it to be in the module i guess

leaden sandal
#

Sure, but it’s the start and nudge I needed

topaz osprey
#

the data object is something you can change colors... stroke width etc

#

at the bottom of the code

#

((rotating currently doesnt seem to work with a circle/ellipse...

spiral vigil
topaz osprey
#

ah uhm

#

then width and height is too much just widht for diameter would have been enough 😄

spiral vigil
topaz osprey
#

there is still some comments in the class that are left overs from from dnd5e's extended template where i lifted the code from 😬

spiral vigil
#

In fact, that would have been my plan if nobody had anything. So, just look at DnD.

topaz osprey
#

yeah when in doubt 😄

#

see if they did it

#

oh i flubbed cancelling >.< never tested that

#

hmm seems cancel doesnt get interactionData... digs

topaz osprey
#

also fixed the cancel problem ...