impixi

Forum Replies Created

Viewing 15 posts - 76 through 90 (of 100 total)
  • Author
    Posts
  • in reply to: XML module #3984

    impixi
    Participant

    @Mark

    Woohoo! Just tried the latest GIT release and have been playing around with the tinyxml module. Works nicely so far. Thanks!

    Here’s an example that builds a mojox tree from that “dream.xml” file included with the banana:

    [/crayon]

    @arjailer

    Thanks for posting your code. I’ll experiment with that later, see how it compares to Mark’s tinyxml wrapper solution.

    in reply to: XML module #3970

    impixi
    Participant

    @Mark

    Anyway, I’m more of a JSON guy myself, but is this pretty much what you need from an xml module?

    That’s exactly what I’m looking for. 🙂

    Regarding JSON, XML, etc. I’m usually an INI or CSV or pure binary data guy, but I’m working on a project where I can actually see the benefit of using XML-formatted data. JSON has never really “gelled” with me, I tend to avoid it.

    Wish people would staring using that module manager thingy though…

    Indeed, that would be nice. :). I have a few half-finished modules I hope to finish soon. I’ll upload them when I do.

    @arjailer

    That Monkey1 module by skn3 is the one I had planned to port if nobody else had started on an XML module…

    in reply to: Drag and drop? #3479

    impixi
    Participant

    Looks like you need to hack Mojo to support dragging items onto the application window.

    Rough “proof of concept” example:

    monkey2/modules/mojo/app/app.monkey2

    Add the following field, property and method to to the AppInstance class:

    [/crayon]

    Add the following function call to the bottom of the AppInstance class constructor, just before the End statement:

    [/crayon]

    Add the following to the Select statement in the DispatchEvent method:

    [/crayon]

    Compile the mojo module. Test it out with the following example.

    sdl2DragTest.monkey2:

    [/crayon]

    As I said, that’s just a proof of concept that works for me (on Windows).

    To make DropEvent behave like the other Mojo event types requires extra work… Something for another time…

    in reply to: MX2- keyword 'friend' #3453

    impixi
    Participant

    Though recognized by the MX2 lexer, “Friend” is an unimplemented keyword. Mark has probably reserved it for possible future inclusion in MX2.

    Assuming “Friend” will allow functionality similar to the C++ equivalent, it can be useful.

    Wikipedia link:
    https://en.wikipedia.org/wiki/Friend_class

    Also read the first “answer” in this stackoverflow thread:

    http://stackoverflow.com/questions/17434/when-should-you-use-friend-in-c

    EDIT: The best example I’ve seen that makes use of “Friend” classes (in C++) is in the object pooling chapter of Game Programming Patterns by Robert Nystrom. BTW, I highly recommend that book.

    The same chapter he also demonstrates good use of Unions (something else not (yet?) in MX2), but I digress… 😉


    impixi
    Participant

    I just noticed that global App variable myself. Was going to correct myself but you beat me to it. 🙂


    impixi
    Participant

    And is there a way to detect the size of the desktop in mojo?

    Store a reference to the AppInstance object and read the DesktopSize property:

    [/crayon]

    Though in my case the returned result is incorrect. I’m running my desktop at 4k (3840×2160) yet the DesktopSize property returns 2560×1440. Not sure what’s going on there…

    in reply to: New PC Build #3238

    impixi
    Participant

    In a relatively high-end system like that, I’d get 32GB RAM and a 1000W power supply. Aside from that, the other components look good.

    What’s your intended OS?

    in reply to: Ted2 1.0.3 crashes when trying to open a file on W10 and W7 #3215

    impixi
    Participant

    The best way to debug ted2 problems is in ted2 – just run src/ted2/ted2.monkey2 in debug mode.

    You’re correct of course. So I tracked down a bug in your “fix”. 🙂

    The RequestFile method in the MainWindowInstance class should be:

    [/crayon]

    “Open” was showing the “Save As” requester.

    I’ve also noticed a bug/issue with the Find dialog when pressing CTRL+F but I’ve run out of time to find it today.

    I suppose I should create a git account and post bug reports and potential fixes the proper way in future…

    in reply to: MojoX Placement/Sizing Code #3198

    impixi
    Participant

    I was planning on posting some “simple” mojox examples demonstrating the various principles and widgets but have encountered “conceptual” issues myself.

    Reading TED2 source is useful for some things but leaves me wondering for others.

    But this isn’t very flexible – in most cases you probably want to use a DockingView as the ‘main’ window/content view. This way, the docking view fills the window (unless you change its Layout!) and you can then add things at the top, left, etc of the dockingview/window.

    Ah, that actually makes sense now…

    in reply to: Ted2 1.0.3 crashes when trying to open a file on W10 and W7 #3197

    impixi
    Participant

    This is happening for me too. Latest git master zip. Win10. The recommended compiler installed in monkey2’s devtools folder.

    EDIT: I just tried on another Win10 system and had the same problem.

    The first 1.03 TED2 did function correctly. The following “TED2 tweaks” release, however, did suffer the problem.

    in reply to: fantomX2 for Monkey2 #2741

    impixi
    Participant

    You could write a little “ResizeArray()” function that uses generics and the array CopyTo() method. Rough example:

    [/crayon]

    EDIT: I should add that the above basically replicates Monkey 1 behavior – slicing and array.Resize() create new arrays rather than truly contracting/extending existing arrays.

    in reply to: Import/Includes and globals? #2431

    impixi
    Participant

    Interesting.

    I’m using 1.0.2 (latest git clone zip) and don’t see that error…

    in reply to: Should "asset::" be plural? #2429

    impixi
    Participant

    One thing I find a bit annoying is I keep mistyping ‘asset::’ as ‘assets::’ – anyone else encountered this?

    Meh, not really bothered mainly just wondered whether other people found it weird too – the physical dir is called ‘assets’ but you access it with ‘asset’.

    Yes, I have found it weird and have been “caught” by it. I would suggest offering both plural and non-plural variations.

    in reply to: Import/Includes and globals? #2428

    impixi
    Participant

    Does this not work for you?

    globals.monkey2

    Global MyVar := 1.0

    start.monkey2

    [/crayon]
    in reply to: ascii and strings #2356

    impixi
    Participant
    [/crayon]
Viewing 15 posts - 76 through 90 (of 100 total)