COS10009 task 5.4C.docx - COS10009 Task 5.4C Hover button test require'rubygems require'gosu Instructions This code also needs to be fixed and finished

COS10009 task 5.4C.docx - COS10009 Task 5.4C Hover button...

This preview shows page 1 - 3 out of 4 pages.

COS10009 Task 5.4C Hover button test require 'rubygems' require 'gosu' # Instructions: This code also needs to be fixed and finished! # As in the earlier button tasks the "Click Me" text is not appearing # on the button, also both the mouse_x and mouse_ co-ordinate should # be shown, regardless of whether the mouse has been clicked or not. # The button should be highlighted when the mouse moves over it # (i.e it should have a black border around the outside) # finally, a user has noticed that in this version also sometimes the # button action occurs when you click outside the button area and vice-versa. # FOR THE CREDIT VERSION: # display a colored border that 'highlights' the button when the mouse moves over it # determines whether a graphical widget is placed over others or not module ZOrder BACKGROUND, MIDDLE, TOP = *0..2 end # Global constants WIN_WIDTH = 640 WIN_HEIGHT = 400
class DemoWindow < Gosu::Window # set up variables and attributes def initialize super(WIN_WIDTH, WIN_HEIGHT, false) @background = Gosu::Color::WHITE @button_font = Gosu::Font.new(20) @info_font = Gosu::Font.new(10)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture