Beginnings of my editor.

About Monkey 2 Forums Monkey 2 Projects Beginnings of my editor.

This topic contains 36 replies, has 5 voices, and was last updated by  Angus 2 days, 4 hours ago.

Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
  • #14816


    I’m an old Amiga fan too..
    If you feel like sharing your GUI code I’d love to have a try!



    Well I’m happy to share the code except for my own shame 🙂  It’s not terrible, but sometimes I have to remind myself of how it works, it’s a bit tangly.  Actually that happens often.

    Not that I want to run myself down, but it’s really not that great!  I draw the whole thing every frame because of an old reluctance to draw to textures in OpenGL.  I’ve sort of overcome this recently (I render viewports to textures) and the change to make it only render what it has to isn’t loads of work, but it’s not going to happen very soon.  For now it still seems very fast.  I’ll probably do it when my editor is nearer finished and speed may become an issue, as levels become complicated.  (not sure about this)

    Most complicating of all, however, is the fact that I modified the mojo Canvas to do my drawing.  It’s a small but significant change that does probably make it a less secure class.  Thinking about how I’d re-work it to use standard mojo drawing things is interesting and probably not difficult.  The changes I made to the Canvas were really for the drawing of my own objects, not the GUI,  I just also use it for the GUI.

    But again I have to say it’s some way down my list of coding priorities 🙂


    All these things being said, if you still want the source, is there a good place to put it?  I’m not protective of it, just a bit self-conscious about it…

    …and it’s totally undocumented, so uh.. there’s that too 🙂



    Actually, when I think about this, I’m not sure how useful it would be.  MyCanvas (my modifed canvas) is basically a change to the Mojo source, so I shouldn’t put it up anywhere.  Without MyCanvas, my GUI wont do much!

    Let me have more of a think about how hard moving it back to Canvas would be.  It really might be easy and make no difference to my use of it.

    Edit – but again, if you think you’d like to see my own source, I’ll stick it somewhere…



    If you’re worried about the licensing, you can redistribute monkey2/mojo stuff, subject to zlib:

    It’s summarised here:



    Well, I guess I could then!  But really I should change it anyway if I’m going to release it, there’s no reason to confuse matters by demanding you use a different Canvas class.  I actually should just go the whole hog and make it render to its own texture as well.

    I don’t really have a page with my stuff on it.  I sort of did a blog thing before, but I’d rather just update this topic with what I’m up to.  The point is I don’t have a standard place I’d put code or anything.  Let me look into getting somewhere and I’ll stick up the version I have, but it could use a tighten up even without changing the Canvas thing.  I’m totally ignorant about where’s a good place to put webpages and small files for free. (poor man)

    As far as the editor is concerned, just now drawing grids is making my head spin, but I’ll get there…



    Work actually came to a halt as a bug emerged in my undo routine.

    It’s not interesting, just a reminder for me about how my code has grown well beyond what I keep in my head, and some bugs will just need hours n hours of looking at lists of numbers.  It’s much nicer and more common for a good guess to sort things out.

    It seems resolved now, though, and I’m much happier with the system having gone through it all to examine it.  Not to mention getting it to produce reams of debugging info, poring through which has reassured me that really it is doing what I think it should be.  Even in the small areas it was going wrong, I’m pretty confident I’ve made it right and sewn up any gaps.

    But it’s tiring at this stage when I feel pretty close to having a lot of the really tricky things sorted, but expect serious and mysterious problems frequently.  One by one I’ll find n fix problems like the one today, but it’s pretty knackering.




    Ok, they’re not very interactive yet and I still need all those hotspots.  I’m just delighted to have got through a couple of days of fighting my maths skills to get to this point, I’ve pursued a couple of dead ends to get here 🙂

    But now they’re drawn perfectly in the correct frame of reference.  I can draw a dim one for the world coordinates and a bright one for the currently selected object.  Now I’ll do the stuff to make them sense the mouse.  All of the hotspots that are there will go except for the rotate one, which I’m not sure how to get rid of and still have the thing usable.

    I’m pretty pleased with my method as well… I’m sure it’s standard stuff for proper maths people but I feel awful proud of myself 🙂


    Edit- thinking about this, it wasn’t putting them in the correct frame of reference that was tricky, but just being properly efficient about what I’m going to draw.  In the past I’d certainly have taken a vaguer approach in a misguided attempt to save having to think too hard.  Anyway I’m wittering.

Viewing 7 posts - 31 through 37 (of 37 total)

You must be logged in to reply to this topic.