./vdo_pause_button_highlight.lua

  1. ---------------------------------------------------------------------------  
  2. -- Vdo_pause_button_highlight 
  3. -- 
  4. -- The highlight behind a botton toggle for use in a megalist. 
  5. --------------------------------------------------------------------------- 
  6.  
  7. -- Standard Init Function 
  8. function vdo_pause_button_highlight_init() 
  9. 	vint_set_property(vint_object_find("highlight_blur_anim"),"state",TWEEN_STATE_DISABLED) 
  10. end 
  11.  
  12. -- Standard Cleanup Function 
  13. function vdo_pause_button_highlight_cleanup() 
  14. end 
  15.  
  16. -- Inherited from Vdo_base_object 
  17. Vdo_pause_button_highlight = Vdo_base_object:new_base() 
  18.  
  19. ---------------------------------------------------------------------------  
  20. -- Initializes VDO Object 
  21. --------------------------------------------------------------------------- 
  22. function Vdo_pause_button_highlight:init() 
  23. end 
  24.  
  25. ---------------------------------------------------------------------------  
  26. -- Sets the button image on the VDO Object. 
  27. -- @param button_icon	Button Icon, please use the globals set in  
  28. --								vdo_hint_button.lua. If no button is provided the 
  29. --								button is hidden. 
  30. --------------------------------------------------------------------------- 
  31. function Vdo_pause_button_highlight:show_button(button_icon) 
  32. 	local button = Vdo_hint_button:new("icon", self.handle) 
  33. 		 
  34. 	if game_is_active_input_gamepad() then 
  35. 		if button.handle ~= 0 then 
  36. 			if button_icon == "" or button_icon == false then 
  37. 				button:set_property("visible", false) 
  38. 			else 
  39. 				button:set_button( button_icon ) 
  40. 				button:set_property("visible", true) 
  41. 			end 
  42. 		end 
  43. 	else 
  44. 		button:set_property("visible", false) 
  45. 	end 
  46. end 
  47.  
  48.  
  49. ---------------------------------------------------------------------------  
  50. -- Sets width of the button highlight 
  51. -- @param width    Width of the highlight in pixels 
  52. --------------------------------------------------------------------------- 
  53. function Vdo_pause_button_highlight:set_width(width) 
  54. end 
  55.  
  56. function Vdo_pause_button_highlight:set_highlight() 
  57. end 
  58. function Vdo_pause_button_highlight:set_color(color) 
  59. 	local bar_obj = Vdo_base_object:new("bar", self.handle) 
  60. 	bar_obj:set_color(color.R, color.G, color.B) 
  61. end 
  62.  
  63. function Vdo_pause_button_highlight:show_bar(is_on) 
  64. 	local bar_h = vint_object_find("bar", self.handle) 
  65. 	vint_set_property(bar_h, "visible", is_on) 
  66. end 
  67.