#anyway 2nd thing wrong with the template: it set the position of the object equal to the position of the mouse
Explore tagged Tumblr posts
Text
Step 1: Be able to click a thing and drag it around
Step 2: Create my own Trauma Center from scratch >:D
#original#there was a template for how to do a click-and-drag thing but it was WRONG so i figured out how to do it better :)#specifically 1: it detected if you click within a certain radius of a point. works great for circles but bad for other shapes#so i got it to detect collision boxes instead which is somehow a non-trivial thing to do#in fact i still think i'm doing it wrong but no one online had a better method#i'm doing it by setting a variable to true whenever the mouse enters the box and setting it to false whenever it leaves the box#which is stupid. i should just be able to ask “is the mouse in the box Right Now” and get an answer#i'm SURE there must be a way to do that but no one wants to tell me >:(#not even the mouse specifically just a general “is This Point in the box?” that's not a hard thing to do is it?#that seems like the simplest thing in the world but apparently the only ways to do it are big and dumb#this should be so common so simple so easy how is this not just a method of CollisionObject?#whatever fuck you i'll just juggle my “overlapping” bool then#gonna make a “Mouseable” object and use it for everything#also i have a theoretical way to recognize sutures! i just need the ability to check if 2 lines overlap#which i thought might be simple but given how tonight has gone my hopes are now appropriately low#also i just realized i also need a way to turn mouse inputs into straight lines. no idea how to do that- WAIT MAYBE#i have a way to tell when the mouse changes direction significantly! that'll let me set the start and end points of each line!#that'll be a real nice strategy when i finally get to sutures#sutures will definitely be one of the more complicated things. start with click-and-drag forceps#and even with just forceps there's some things that have Rules to how you pull them out so that'll be a process#anyway 2nd thing wrong with the template: it set the position of the object equal to the position of the mouse#which means even if you grab the very edge it'll suddenly snap so that you're holding the center. not good
0 notes