Joh
Member
Hello,
I am wondering what would be the best way to handle an editor, think the GM sprite editor or room editor, paint, photoshop etc.
There's the GUI and the actual content which can be scaled, moved etc.
I can think of a few ways to go about it, but mostly want to keep it simple.
One of the problems I'm seeing are coordinates. Different canvas size lead to different x,y positions. I could recalculate position at any scale/canvas change (x/prevsize*newsize) but this seems off and prone to edge cases issues.
I could have all coordinates as % of the canvas. Seems the simplest but feels wrong, I also don't think I've seen that elswhere.
Views have the opposite problem where what you see is not representative of true positions. mouse_x/y can need conversions which is also annoying.
Surfaces are pretty much the same.
So I guess I'm calling all options unpleasant... I prefer when the x/y matches what I can see, but perhaps there's no choice here.
I already work with surfaces, so its not like I can't do it, I just thought I'd ask around for possibilities, perhaps I overlooked something or I'm overcomplicating the ideas.
Wouldn't want to re-invent the wheel or miss out on existing approaches.
Thanks!
I am wondering what would be the best way to handle an editor, think the GM sprite editor or room editor, paint, photoshop etc.
There's the GUI and the actual content which can be scaled, moved etc.
I can think of a few ways to go about it, but mostly want to keep it simple.
One of the problems I'm seeing are coordinates. Different canvas size lead to different x,y positions. I could recalculate position at any scale/canvas change (x/prevsize*newsize) but this seems off and prone to edge cases issues.
I could have all coordinates as % of the canvas. Seems the simplest but feels wrong, I also don't think I've seen that elswhere.
Views have the opposite problem where what you see is not representative of true positions. mouse_x/y can need conversions which is also annoying.
Surfaces are pretty much the same.
So I guess I'm calling all options unpleasant... I prefer when the x/y matches what I can see, but perhaps there's no choice here.
I already work with surfaces, so its not like I can't do it, I just thought I'd ask around for possibilities, perhaps I overlooked something or I'm overcomplicating the ideas.
Wouldn't want to re-invent the wheel or miss out on existing approaches.
Thanks!