Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Forum
Search
Topic SCROLLABLE Items list selection By nifriz Date 2019-08-19 06:42
What you mean?
Topic SCROLLABLE Items list selection By nifriz Date 2019-08-12 07:59
I Found this solution by myself:

PREPARE CACHE ITEMS (Show 4 items)

def cache_items
    @cached_items = Gosu.render(MAIN_X + MAIN_WIDTH, MAIN_Y+MAIN_HEIGHT) do
       count = 0
       @items_array[@first_item..@first_item+3].each do |elem|
        elem['img'].draw(MAIN_X + OFFSET_X,
                         MAIN_Y + OFFSET_Y + 100*count,
                         3)
       Gosu::Image.new(Gosu::Image.from_markup("<c=FF0000>#{elem['txt']}</c>", 25, bold: true))
                              .draw(MAIN_X + OFFSET_X + 100,
                              MAIN_Y + OFFSET_Y + 100*count + 25,
                              3)
        count+=1
       end
    end
end


When User click on up/down Arrow, @first_item will be decreased/increased and i re-cache the items.
Topic How do I make an enemy target a moving player and fire? By nifriz Date 2019-08-12 07:52
Hi,
you must calculate the angle.

tan^−1 delta_y/delta_x=θ

Where θ is yor angle, delta_y and delta_x are coordinate difference between your character (player and enemie).

Calculated the angle you can draw image rotated, using draw_rot method instead of draw.

Maybe this mine little Ruby test can helps you , how to use draw_rot
Topic SCROLLABLE Items list selection By nifriz Date 2019-08-06 13:37
I'm trying to create a Ruby little RPG, and I'm managing the "Character Info".
In the Info page a body image is shown, you can select a body part (I override part with another image to give the feeling is really selected) and now I want to do the next step.
When the part is selected, I want to sho an image list of compatible items, where you can select one of it.

For example, if you select head, i will show you all the helmet in your items list.

Any idea how to create this scrolalble list (graphically) on the screen?

Somenthing like this but scrollable...
Topic Create a progress bar By nifriz Date 2019-02-12 14:17
Ok, it's a sly hack, thank you!
Topic Create a progress bar By nifriz Date 2019-02-12 12:49
I'm working on a little game, and I need to put on screen a progress bar...
How can I do it with Gosu? I need OPENGL? If yes, some advise about gem to use and some simple example?

Thank you

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill