Mark Sibly

Forum Replies Created

Viewing 15 posts - 511 through 525 (of 1,431 total)
  • Author
    Posts
  • in reply to: Is Monkey X documentauons works for Monkey 2? #10259

    Mark Sibly
    Keymaster

    No, the monkey x documentation is for monkey x, not monkey 2.

    If you are unhappy with the monkey 2 documentation, I suggest you take a break from monkey 2 for a while and try again in a few months time or so when the documentation should be much improved.

    I am in the middle of writing a 3d engine for monkey 2 and right now that takes precedence, but I’m planning on a big docs effort once that is nearer completion.

    in reply to: Monkey 2 vs AppGameKit #10252

    Mark Sibly
    Keymaster

    Well, there you go. If you want blitzbasic 2.0, go for AGK. If you want a language with perhaps some more modern features, perhaps look into monkey2 – it’s your choice. Locking this now as it looks like its going nowhere.

    in reply to: Monkey 2 vs AppGameKit #10249

    Mark Sibly
    Keymaster

    I have never used AGK so I have no idea what it’s really about. Is it a programming language? A C++ library?

    Why not try both and use the one you like the most! Programming tools are a very subjective thing so there’s really no ‘right’ answer here.

    in reply to: Modules/std/audio/audiodata update #10236

    Mark Sibly
    Keymaster

    And here’s a little test app:

    in reply to: Modules/std/audio/audiodata update #10235

    Mark Sibly
    Keymaster

    Nice attempt but it’s not quite right – the Mono8 case at least is broken (haven’t looked at others) as it will convert 1.0 to 0 (should be 255). But this is a long overdue addition anyway so here’s my attempt:

    Note that GetSample will never actually quite return +1.0 (it will return .999 etc for max sample value). This reflects the fact that there are actually fewer sample values>0 than there are <0. Googling around suggests this is the best way to handle that. You can still SetSample 1.0 for max value no problems, it just wont read back as exactly that.

    in reply to: MojoX GUI questions #10231

    Mark Sibly
    Keymaster

    Also, forgot about UpdateWindow(). Add this to the end of TestGui ctor:

    UpdateWindow causes a full window layout update so should be used sparingly, but I think its the right solution in this case.

    in reply to: MojoX GUI questions #10230

    Mark Sibly
    Keymaster

    Actually, ‘field’ inside of method would be cool!

    in reply to: MojoX GUI questions #10228

    Mark Sibly
    Keymaster

    Hi,

    Here’s my little hack for initial auto-centering. Just replace RightDock.OnRender wth this:

    OK, it’s still not all that pretty, and also relies on a ‘done’ style flag. This is alas not easy/possible to do in the ctor because the gui has not been laid out yet – layout is done just before render so while ctor is executing, nothing has been measured/positioned yet.

    I chose this design to minimize layout overhead and to simplify things. Another approach is to, as nerobot says, make views update layout in response to resize events, but in my experience this can lead to considerable layout overhead, and even layout ‘lockups’,  esp. in the case of complex hierarchies as one resize can trigger lots of layout code. I’m not adverse to adding a SizeChanged event, but I am against the idea of it being used to trigger layout.

    Mojox uses a pretty simple layout system (largely pinched form Android). Layout is a 2 pass process and is always performed just before rendering (could be optimized/improved here). In the first pass, views are measured ‘bottom up’ using OnMeasure. This initializes their MeasuredSize property. Since measuring is bottom up, parent views can therefore depend on children having already been measured when measuring themselves. In the second pass, views are positioned/laid out ‘top down’. This way, everything is measured *exactly* once, and positioned *exactly* once. Also, properties like ‘Rect’ and ‘Frame’ etc are updated once and always in sync with each other and their true ‘render position’.

    There are of course some limitations and issues with the mojox approach. Layout of things like wordwrapped text or html views is tricky, because view height is dependant on view width, and there are some hacks in there for dealing with that . And having layout occur ‘at some point in the future’ can sometimes be inconvenient, but in my experience the benefits are worth it. YMMV.

    in reply to: Mark – SDL_MIXER example #10218

    Mark Sibly
    Keymaster

    Have a look at vsynth in bananas. It’s written by skidracer who knows more about SDL mixer than I do.

    in reply to: MojoX GUI questions #10217

    Mark Sibly
    Keymaster

    The use of percentages in docking view means the pane is always that percentage of docking view size, so absolute size will only change if docking view size changes. So a pane that is 25% is always 25%. If you change sizes to pixel size (eg: “60”) it works the way you want, although DockingView is really designed to have a ContentView so may have a ‘hole’ in the middle. I agree percentage sizes should probably have a resize knob too if ‘resizable=true’ and the percentage should mean ‘initial’ size. Will have a look at fixing this.

    Another thing you can do is to just keep adding stuff to the “left” of a DockingView so it’s ‘stacks up’ left to right. Then, if you make the last view the ‘ContentView’ you can completely fill up the DockingView as the content view fills up the space left over after all ‘docks’ are added. Just noticed nerobot suggested something similar with VerticalLayout…

    Your scrollview isn’t scrolling at least because it doesn’t have any content –  you need to set the ContentView property. The content view of  a scroll view should also have an OnMeasure method as  ScrollView uses content view’s MeasuredSize to determine how large scrollable content is, how large to make scroll bars etc.

    Here’s a little scroll view demo showing the basics. Note this doesn’t extend ScrollView as there’s little point here, although if you want to customize scroll wheel handling etc you can do so. Scroll wheel handling in ScrollView uses font height for scrolling I think.

    in reply to: Lighting a 2D Image without bump? #10201

    Mark Sibly
    Keymaster

    I did briefly hack LoadBump so it didn’t need an actual normal map to load – instead it used a default  0,0,1 normal map. This alone allowed you to run stuff like simplelight and lightsparks without having to use bump/specular maps. I reverted this though as I wanted to spend more time on it.

    The only bit ‘wrong’ about this is the light intensity was still being multiplied by the ‘N dot L’ term of the lighting equation, which will give different intensities depending on relative positions of pixels/light, which is probably not want you want. I’m guessing you’re after a more full on 2d effect that ignores light direction etc, and this should be doable by tweaking the existing lighting shader a bit.

    I now tend to think that just keeping everything 2d and hacking around with blending and offscreen rendering is probably the better solution anyway as even with a hacked lighting shader, you’re still gonna have to do some kludgy rendering to achieve the groovy ‘light cone’ effect. On the other hand, the light shader approach will actually integrate with shadows should  you want to use them.

    Anyway, either approach will take a bit of time to experiment with, but like I say it could probably be done right now without having to get down with shaders by using a combo of fancy blending modes and offscreen rendering.

    in reply to: Lighting a 2D Image without bump? #10199

    Mark Sibly
    Keymaster

    Sorry, but I’m a bit busy with other stuff and wont be able to look into this for a while yet.

    You are of course welcome to try yourself! It should be fairly easy with a combination of multiply/additive blending and offscreen rendering. You are likely to have to tweaks things a bit anyway if you want to get *exactly* the same result as above which highly stylized.

    in reply to: Lighting a 2D Image without bump? #10198

    Mark Sibly
    Keymaster

    I wont be able to do this right away, I have some other stuff to finished up first.


    Mark Sibly
    Keymaster

    I am expecting the site to be hit with a ton of South Korean casino spam any day now!

    in reply to: ARCore and ARKit Support? #10184

    Mark Sibly
    Keymaster

    Ok, spoke a bit quickly there, neither my ios or android devices support AR. Bummer.

Viewing 15 posts - 511 through 525 (of 1,431 total)