sneak preview of new ui controls

About Monkey 2 Forums Monkey 2 Projects sneak preview of new ui controls

This topic contains 17 replies, has 5 voices, and was last updated by  AdamStrange 2 years, 7 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #3367

    AdamStrange
    Participant

    I was impressed by the recent widget done with mojox, so I decided to try and get V1.02 and V1.03 monkey2 synchronised.

    Here is the result. So far there is a base button and a grid control.

    The grid control can be subclassed and in this case is shown subclassed into a color picker and also an image picker.

    When picking a color the button changes to that color

    Basically I am going to create a sprite editor

    Here is the main code to see the basic layout and lambdas:

    Note the button can have different text looks, also text is now Aligned with proper Align.

    E.G. ALIGN_LEFT | ALIGN_TOP, or ALIGN_BOTTOM

    None of the nonsensical ‘gravity”

    The grid control can be programmed with different grids E.G. 2×3 or 1×12, etc

    This is V1.02 code. The V1.03 only has one line changed, so should compile straight off with no problems

    #3369

    AdamStrange
    Participant

    Creeping forward now with a basic paintpad:

    #3371

    AdamStrange
    Participant

    Lastly a bit of alpha:

    #3397

    AdamStrange
    Participant

    now with saturation allowing fine control over colors, clear color, random rotation of brushes giving very subtle effects:

    #3403

    wiebow
    Participant

    Ohh, nice!  I’ll stick to Aseprite for now though!! 🙂

    #3405

    Simon Armstrong
    Participant

    None of the nonsensical ‘gravity”

    Gravity is a view property in most modern layout engines. From the mojox documentation:

    if a view’s layout is “fill”, the view is resized to completely fill its frame; if layout is “float”, the view retains its measured size but is positioned within its frame according to its View.Gravity.

    Typically alignment is a feature of a text paragraph left, center, right or justified and hence doesn’t really represent the same property in my mind.

    #3406

    AdamStrange
    Participant

    textalign = ALIGN_LEFT – yep

    textalign = gravity(0, 0) – nah

    I’ll stick with align 😉

    #3407

    Simon Armstrong
    Participant

    OK, I don’t understand. You have added a textalign property to labels?

    label.Gravity.X=-1  ‘ awesome

    #3409

    AdamStrange
    Participant

    nope, but I can create a new control label with this if you want it?

    I come from windows controls and traditional page layout. so left aligned text is on the left, right aligned is on the right, centered or middle is in the middle

    similarly vertical align is top middle or bottom

    So top left = ALIGN_TOPLEFT

    or bottom right = ALIGN_BOTTOMRIGHT

    I should add that all this stuff does not touch mojox controls. these are new.

    Slight update. added ability to pick a color from the canvas and put it in the base palette:

    This is consistent with the Quantel systems (Paintbox, Harry, etc)

    Loading saving of palettes will be the last before everything starts to get integrated directly into ted21

    #3436

    AdamStrange
    Participant

    Added panel and more controls

    This shows the flexibility of Mojox as a control system.

    Here are some file additions and new palette sizer. There was a bit of crashing until I found I needed Update() after hiding/unhiding controls. after that it all went smooth

    Also added image buttons and image checkbuttons

    The grid need a little tidying, but it all works very smoothly

     

    The only minus is to do with GUI complexity. the more you add the more things get messy. But that is a problem all GUI’s have: there is more code dealing with the GUI than with the actual meat of the program.

    MojoX goes some way to making this a simple thing

    #3442

    AdamStrange
    Participant

    Just to show something different can be done.

    Here is a base prototype synth UI – Yep I redid the label control now as well

    It’s based on the Roland Juno 60 design

    #3447

    nobuyuki
    Participant

    Nice work Adam.  Always love to see people experimenting with making painting or composing tools and associated code.

    #3467

    AdamStrange
    Participant

    just been implementing some basic brush styles there are four types:

    normal, alpha, scatter, scatter alpha

    I’ve also implemented loading of images into the paint palette, so you can pick up colors, or even paint back onto the image (although it’s really meant for color mixing)

    #3470

    AdamStrange
    Participant

    I think the best thing now is to directly integrate the paint control back into ted21

    From there have two new document types:

    palette – collection of colors up to 256 entries. palettes can be loaded by the paint control and also created and saved by it too.

    brush – 256 x 16 pixel size, which is 16 brushes. these can then be edited and saved. And also loaded by the paint control.

    In essence the brush document is a fixed size horizontal sprite atlas.

    I suppose next up would be to make a sprite atlas/sprite document next with would be a simple case of extending the above brush document.

     

    Behind the scenes I’ve also adde functions into mojo/graphics/canvas for full support of the brushes and atlas functions, including non square sprite rendering (deformations) – if anyone is interested

    #3472

    gcmartijn
    Participant

    @adamstrange

    Does Ted21 going to use the latest MX2 version ?
    I can see problems if you are behind the main version, and people want to use the latest MX2 version.

    Maybe you can concentrate to write modules for the official ted2 version.
    That way your work is future proof and you reach more people 🙂

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.