Posts: 11,235
Threads: 649
Joined: May 2009
Sometimes, it takes a while for a solution... and mebby a small break to get away and get a new perspective.
I began reworking how the text system for the icon list box feature worked and displayed the text. AND, I did it with much success. I blew up the window so you can see it more clearly. But I now have the text rendered cleanly and with a nice shadow effect (which MAY be disabled).
The system will increase the vertical spacing if the text it placed too far below, as can be seen in this example. I do plan to institute text justification, so there will be left/center/right options. But admittedly, text may become 'scrunchy' if you place TOO MUCH text in an icon window. Well, that's assuming you don't increase the actual spacing between icons yourself when defining them.
Technically, there is no ICON BOX widget in any Windows OS system that I have seen. But it is a nice touch, eh?
Outline as well as Shadow (and color options therein) will be available ... methinks.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 11,235
Threads: 649
Joined: May 2009
09-08-2023, 04:58 AM
(This post was last modified: 09-08-2023, 04:59 AM by DerVVulfman.)
The Icon list I just presented now have a whole cadre of commands... FUN stuff. But when one is trying to emulate Windows objects, one must account for a variety of functions.
So far, the basic syntax for a list that shows the icons prominently appears like this:
Syntax:
object = Widgets::IconBox_List.new(x, y, icon-width, icon-height, columns, spacing, data-list)
Returned:- object: The list object created
Parameters:- x : x-coordinate of the list
- y : y-coordinate of the list
- icon-width : width of the icons used in pixels
- icon-height : height of the icons used in pixels
- columns : how many vertical columns in a list
- spacing :how much spacing (vertical and horizontal) between icons in pixels
- data-list : the full list under control, each item contains: [icon, caption, data returned]
And on top of that, you can set the following after:
object.list_border_color = Color -- Sets the color of the outside list border
object.list_fill_color = Color-- Sets the background color of the list
--
object.icon_border_color = Color -- Sets the color of the individual icon borders
object.icon_fill_color = Color-- Sets the background color of each icon
object.font_name = String-- Set the font used in the icon's caption
object.font_size = Numeric-- Set the size of the font font used in the icon's caption
object.font_bold = Boolean-- Set if the font used is boldfaced
object.font_italic = Boolean-- Set if the font used is italicized
object.font_align = Numeric-- Set if the caption is aligned left, right or centered
object.font_color = Color -- Sets the color of the caption text
object.font_style = Numeric-- Set if the caption is plain, shaded, or outlined
object.font_stylecolor = Color -- Sets the color of the shadow or outline effect
object.outline_list = Boolean -- Sets if the list itself has an outline or not
object.enable_item(index) -- Sets a specific icon by index position as enabled
object.disable_item(index) -- Disables a specific icon by index position
Currently, I can use the mouse to point-n-click and switch objects within the same one list. I need to see about taking objects from one list to add into another. THAT will be fun.
But a lot has been worked out.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 451
Threads: 15
Joined: Feb 2021
Sooo... I haven't posted aught of it yet. But I might have started making a new game because I'm presently at a stage where I'm just waiting on resources for Fantasia.
So, with that, may i introduce you to:
Flight
As the name suggests, it's a game with a large emphasis on flying. It transitions between a sort of multi-layered world map where you can descend to lower levels where harder and harder challenges will appear. Then during all the bullet hell sequences, you're flying too.
Into Combat!
I'm using Galv's Map projectiles as the basis of this game's combat, which is working very well. It's WASD movement and mouse aim and mouse-click for shooting. it's very modern-day controls and it's so nice to have mouse support for this game.
Did all the battle stuff seen in this video in the span of today. let's see what I achieve tomorrow~!
Posts: 11,235
Threads: 649
Joined: May 2009
Work on the Windows-Styled Interace Widgets continues...
[attachment=1961]
The video attached is poor quality, I grant you. But I intercut it a little and showed that the checkbox in the upper left most window can change from a checkbox with a caption (captions are always optional), to buttons that can be depressed, to radio buttons. The red dot indicating the radio button was selected is customizable of course.
But I show off two things.
The first is the dropdown window. The window, when the list is not shown, is merely a simple box with a caption. And initially, you can see it with the [V] collapse button on the left as it appeared with Windows 3.1. And oddly, I set the box's text to be italicized, bold-faced and right adjusted. HOWEVER... a little bit if intercut and you can see that the collapse button need not be needed, and I set the text to be centered. And a third cut, I set the text to NOT be italicized, and returned it to a more acceptable left-justification.
Meanwhile, I worked on a feature for right-clicking objects. Returning to the radio button, right clicking brought up a list menu with two options: Checked and Unchecked (blurry as they were). And indeed, the right click window was able to accurately function.
One thing that I had issues with in past I never mentioned was the priorities of window buttons when menus were overlain. For example, if I had the START menu resting atop of any of the WIDGETS windows, the three buttons in the start menu would not work if the area I clicked was simultaneously atop the WIDGETS window. But now, proper z-Depth was established and whatever window "AND BUTTONS" that are on top are active.
I still have a few things to tweak with the checkbox and some of the work behind the scenes. And I want to establish two more widgets, a "Hover" widget and a "Text Box" widget that you can type within. The hover widget would be one which would appear atop the mouse with a little bit of 'help' indicating what the widget performs or any random information related. And the Text Box widget... well, that will be more based upon the full-keyboard and text-entry system in use.
I will try to make it as least-intrusive as possible.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 11,235
Threads: 649
Joined: May 2009
Some sections just needed a bit more cleaning up...
List boxes in general, those that are fixed and do not scroll, there are no options highlighted. Yes, when you click an option, it becomes highlighted... but nothing is highlighted or selected by default. It is by mouse action and clicks that bring up a response.
But for scrolling lists, both in general and for the dropdown lists, the first item within their respective lists is highlighted by default. In fact, it is established as index position 0 for those that understand arrays or just that lists in this manner begin at 0 and not 1. THIS CAN CHANGE though, as the index position can be set at any time...
During the execution of this demo, I programmed the dropdown list on the right to highlight index position 3 at start.
As I stated earlier, list boxes highlight the information when you 'click' an item. In truth, when you click an item in any list, it is possible to just GET the desired information after the mouse click. But for the dropdown list, I added some nuances. First, the dropdown list's 'Title' now reflects the item selected just as any other Windows Dropdown widget would. And second, when you have an item highlighted within the dropdown list, the widget stores the data for the highlighted selection for retrieval at any time... not just when you click it.
Hrm... Perhaps that should be in the general 'scrolling' list boxes too. Yeah, sounds like a plan.
Lastly, I'm showing off in the upper-left a simple menu that appears when you 'right-click' over a widget that has a right-click option. Again, right-clicking the radio button brings up a menu and you can click either option that can affect the button itself. But now I set all available font and font background options to be editable properties after the object's creation. I know... that is an ugly shade of yellow. But every option does work.
But first... no. When you move the mouse over any items, the items are not highlighted. List items are only highlighted when clicked. So no menu will initially highlight what item you are targeting. And that includes the right-clicked options.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 451
Threads: 15
Joined: Feb 2021
09-18-2023, 02:27 AM
(This post was last modified: 09-18-2023, 02:28 AM by Remi-chan.)
I got very productive last night and implemented basically everything I wanted!
-Grazing
-Drops and Pickups
-Boss Bars
-Powerups
-Spellcards
Fixed some issues and done some tweaks since the video, too.
I also have been sprucing up the various areas with lifey stuff! Critters, to be precise!
There we go~!
Posts: 11,235
Threads: 649
Joined: May 2009
A major hurdle achieved...
The ability to properly make the scrolling list and dropdown windows...
...visible and invisible on demand!
I programmed my test system to turn on or off the visible state of one scrolling listbox (of two) and the dropdown if the radio button (checkbox) is enabled. So yes, this status works as it is executing. NEEDED OBVIOUSLY.
And I've looked through some visual compilers and I generated a list of the widgets that are drawn on a form. Or in layman's terms, the stuff drawn in your application window you click, type or whatever within.
- Picturebox: Not needed. Use of bitmap routines should suffice
- Label: Not needed. Use of draw_text should suffice
- Text Box: Needed. Must implement means for keyboard script adaption.
- Frame: Not needed. I mean... it just draws a box to put stuff within.
- Command Button: Done. But I do want to tweak fonts
- Check Box: Done.
- Radio Button: Done. (Combined with Check Box)
- Combo Box: Done. Dropdown Box.
- List Box: Done. Both scrolling and fixed
- Scroll Bars: Done.
- Timer: Not needed. Anyone using this should be familiar with HUD-based timers.
- Drive List Box: Not needed. An expansion of Dropdown Box *
- Dir List Box: Not needed. An expansion of Scrolling Listbox *
- File List Box: Not needed. An expansion of Scrolling Listbox *
* While the Drive/Directory/File boxes are not being developed as their own widgets, I may develop code that could be use ... later.
So with that major hurdle done, I just have the actual text entry box to develop. However, I must be honest and say it will more likely be a wrapper for the input system I am using. I am unsure how well it will work with other keyboard scripts.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 11,235
Threads: 649
Joined: May 2009
Well, I may NOT be able to embed user-editable Text Boxes into my widgets system. However, its not for me being unable, but for that there are so many 'differing' full-keyboard systems out there that a wrapper would not be possible. The variables between all the varieties are just SO damn different. So keyboard input into an editable text box is really left to the end user.
But I'm certainly not done!
Scrolling number boxes are available in two varieties... one has left/right arrows on either side, the other has up/down buttons on the right side. The numbers scroll beautifully AND the dimensions of the widgets have a nice range.
For button height sake, the number boxes cannot be any shorter than 12 pixels, that because the option for up/down arrow buttons would only allot for a 6px tall button each and drawing up/down arrows does require some space. However, the right number box example shows a window of 20px in height. So you can obviously make them taller.
OH, and I mentioned that adding drive/folder/filename widgets might be left to the end-user? I had no idea how easy it was to get all the Drive letters for a PC.
Code: for i in 65..90
drive_letter = i.chr + ":"
p 'We found ' + drive_letter if FileTest.directory?(drive_letter)
end
Stupid code goes through ASCII characters 65-90 (or letters A to Z), adds a colon (:), and checks if the root directory (the drive in this case) exists.
Works for me, returns all my drives including USB drives. Simple and useful to propagate a Drive Listbox.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 11,235
Threads: 649
Joined: May 2009
Dear LORDY... this looks like a mess:
However, it is a beautiful mess.
In essence, I set up all the widget backgrounds to allow for bitmap loadable graphics to be used for the window backgrounds and the title and dropdown combo bars. Along with that, the graphics can be stretched to fit the area or set to tile. With the 32x32 dot-dot-dot graphic I used, I basically set window areas to be 'stretched' to fit, while the title boxes are tiled.
OH... except the center "Start Menu". In that case, I only affected the title bar and not the drawing area.
On top of that, the title and dropdown combo bars also allow for color gradients, such as the right-most combo box. Okay, its the ONLY combo box. But it does a gradient shift from pale blue to a yellowish tint.
AND the list boxes can have bitmaps behind the text, using lined bar images in the basic list box, one of the scrolling list boxes and one within the Dropdown Combo box.
All of this is of course optional. And my next target will be the Window Closing [X] buttons, the [V] Expand button for Combo Boxes, and the Scrollbar arrow buttons.
After that... who knows?
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 4,607
Threads: 543
Joined: Dec 2009
09-24-2023, 03:47 AM
(This post was last modified: 09-24-2023, 04:44 AM by kyonides.)
I recently noticed that the FluidSynth library for Linux had been upgraded since I last had installed it months or even over a year ago. Something makes me think its release version jumped from 1.0.x to 3.0.x on my distro in the last couple of months or weeks. Or probably just a few days ago...
Normally, I would not suspect anything from it for I first thought it was a minor update instead of a major one, like from 1.1 to 1.3 or the like. How wrong I was!
As of now, HiddenChest for Linux is compiling fine. I get no errors besides some of Ruby's CXX args warnings because they wanna make me refactor some basic code in its code base. It seems to be optional for Ruby version 2.7 so far. Not gonna happen any time soon, Ruby Header Files.
I guess that could change if I upgrade Ruby to 3.x in the future. Not keen on that for sure.
The major issue was finding that stopping a MIDI and reading a second audio sample, namely some OGG or WAV file, could cause it to failed for no specific reason.
So I started digging on the web only to find out that it was either FluidSynth related, kind of unlikely, or SDL_Sound based. I went this route, and what I found out was that I had missed the fact that there was a brand new SDL2_Sound project!
Thanks to getting its source code and some feedback provided by gdb tool, I discovered that the main issue that was causing the error and the fatalistic / apocalyptic core dump was an arithmetic exception.
My first suspicion thanks to my experience in programming and mathematics was that it should be some sort of division by zero kind of error. Actually, I failed. But I got very close indeed!
The actual problem was that the divisor was equal to nothing.
Not even its arithmetic equivalent, the dreadful 0!
Now after checking the code for any differences, something I usually / always do manually, I found out the root cause!
The integer data type was not some uint8_t integer but some uint16_t one!
Now it does return the dreadful 0 that I was talking about a few moments ago...
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
|