BerryBots forums

It is currently Sat Nov 27, 2021 3:05 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Mar 15, 2013 8:25 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
I've started work on debug graphics - letting a ship/stage draw whatever it wants to the screen (if the user enables it). Here are the API calls I’m planning to add.

  • Circle: x, y, radius, fill color, outline thickness, outline color, duration
  • Rectangle: bottom, left, width, height, rotation (around center), fill color, outline thickness, outline color, duration
  • Line: x, y, angle, length, thickness, fill color, outline thickness, outline color, duration
  • Text: string, bottom, left, font size, color, duration
  • Note: Font size, colors, thicknesses, and duration are all optional with sensible defaults.

Can you think of anything you’d want to do with debug graphics that couldn't be covered by these?

The main omissions I see are alignment options for text, and arbitrary polygons (triangles, hexagons, etc). I think the ratio of complexity to utility is high enough for those two that I can leave them out for now. I can always add them later if there's demand.

Note that I prefer that the API be a minimal set of operations. You can always write helper methods yourself to draw more complex shapes (arrows, stars, graphs, etc). And if I did provide complex shapes, I’d rather provide a Lua module built on basic operations, which you can reuse/modify/learn from, than bake them into the base APIs.

Rectangle and line have a lot of overlap, so initially I only wanted to have one of them. But the inputs are very different. Converting the inputs between these two formats would be a big pain. It would also require trig, while I can draw either of the above functions without using any trig (well, leaving the trig to the GPU).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group