Skip to content

Instantly share code, notes, and snippets.

@whyrusleeping
Created February 20, 2013 04:50
Show Gist options
  • Save whyrusleeping/4992980 to your computer and use it in GitHub Desktop.
Save whyrusleeping/4992980 to your computer and use it in GitHub Desktop.

##Control

This is our base class

	int x
	int y
	int width
	int height
	int max_height 		// defaults to height
	int max_width		// defaults to height	
	
	string text			
	string[] textlines	// defaults to text
	
	
	func onDraw()		
	func onResize()		

##Button

	Is a Control
	bool selected 		
	func onSelected() 	
	func onActivated() 	

##Panel

For not directly accessible content, basically a layout container

	Is an Object
	control[] controls
	
	func OnDraw()
	func OnResize()

Scroll Panel

For content that can be scrolled through

	Is a Panel
	int max_index
	int min_index
	int cur_index
	
	func OnDraw()
	func OnResize()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment