Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Mouse Selectables

While I was working on my wizard i realized the mouse doesn't bring down the list(window_selectable).

I have this code here, in update;
PHP:
    if mouse_over?(self) and @item_max > 0 and @index >= -1
      w = (self.width / @column_max - 32)
      xpos = $mouse.x - self.x - 16
      ypos = ($mouse.y - self.y - 16)
      i = (ypos.to_f/(32).to_f).floor
      i *= (@row_max == nil ? 1 : @row_max)
      if i + (xpos.to_f/(w).to_f) > 0 and i + (xpos.to_f/(w).to_f) < @item_max
        i += (xpos.to_f/(w).to_f).floor
        self.index = i if i >= 0 and i < @item_max
      else
        self.index = -1
      end
    else
      self.index = -1
    end

any ideas?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top