(LUNA) Please help with item menu

● ARCHIVED · READ-ONLY
Started by RPGVeir 4 posts View original ↗
  1. This is pretty much the last thing I want to achieve with Luna Engine but it never works as intended for me.
    What I want to make is probably one of simplest possible item menus.

    The upper menu is what I want it to look like, the red stuff are items and their cursor lenght, height etc.
    The abomination below it is what I actually get from my Luna config. No idea why.

    upload_2018-9-26_10-6-34.png

    Here are my Luna settings and real in game screen with how it looks like...

    upload_2018-9-26_10-8-27.png

    I think I gave proper numbers for both window height and padding. It should work properly, right? ._.
    Another thing is that downward item scrolling is busted, the items dont get replaced properly. Test item y3 is not on test item y1 spot. It's much more below...

    This is how I want it to look like when player scrolls items

    upload_2018-9-26_10-24-34.png

    You get the idea? Items 1 and 2 dissapear offscreen and rest goes up revealing item 7 and 8.

    Please help, I'm too much of a noob to understand this script I guess...
  2. When I change items vertical spacing to be 0, then items perfectly swap their positions... Why I cant have same effect with items spacing being above 0.
  3. bump, anyone? :(
  4. RPGVeir said:
    This is pretty much the last thing I want to achieve with Luna Engine but it never works as intended for me.
    What I want to make is probably one of simplest possible item menus.
    ...

    First, I'm going to make the disclaimer that I don't actually use Luna Engine myself. When I took a look at the sample back before it was even released for VXAce, it seemed mostly just a way to manipulate window properties via module (instead of directly in their classes) with the added ability to insert pictures into certain elements. Perhaps the full version ended up having more features, I'm not sure. Last I heard, it still doesn't support animations, which is mostly what I'm interested in.

    But that being said, I have done my own custom (animated) menus before so I do have some knowledge of how window scrolling and cursors work. And this problem does look somewhat familiar.

    It looks like what happens when you try changing the size of the "item_rect" without changing the size of "item_height". Usually, "item_rect" is what gets used to calculate where to draw the text and icons in a window. But "item_height" on the other hand is used in the scrolling logic and to determine the internal size of the window (the "contents_height"). It also determines how much padding is on the bottom of the window ("padding_bottom") - this bottom padding is what cuts off any stuff that should have been drawn there.

    In this case, unless Luna Engine has severely modified how the windows work, this is your Test Item 5 and 6. I don't think Luna has modified it that much, though. Looking at the screens you've provided, you are missing exactly 16 pixels from your bottom items. This is exactly twice your "ver_spacing" set in the config, which appears twice in each column because of your other two items above.

    My best guess is that this "ver_spacing" element is inflating the size of the "item_rect", making the total height 32 (24 "height" + 8 "ver_spacing") while the internal size of the window is still being drawn assuming each item is still 24px high. I notice your "item_height" in the first set of settings is still 24. This makes it so that when you scroll up/down, you're only scrolling 24 pixels instead of 32. Thus Item 3 looks out of position because its label has been drawn 8 pixels further down than that (and if you had even more items to scrolls, each would be drawn 8px even more out of position than the last - the last few items probably would not even appear at all since the internal height wouldn't be big enough to accommodate them).

    Now, you might think after reading all this that there is an easy fix - all you have to do is change "item_height" to 32. But then you see your window's external height, which is 108 pixels. After subtracting the padding twice (once for the top, again for the bottom) you are left with a window of height 88. If you set "item_height" to 32 pixels, only 2 items would display in each column, since 3 items are 96 pixels high and the bottom padding would automatically completely cut off the last item (which is the entire purpose of the bottom padding - only partially-cutting stuff like you saw is not really supposed to happen and is a sign that something is wrong).

    The only two solutions I can think of to that problem is either to increase the window's external height (to 116 pixels) or to directly modify the "padding_bottom" so that it does not cut off your last item. The former is the easiest to implement, the latter requires scripting knowledge as well as coding around any modifications that Luna Engine might have made to it.

    This, of course, assumes that my guess about how much Luna Engine actually affects is accurate and that this is not a bug that is specific to the modifications made by Luna Engine in particular.