From 89c82c69a26c31995faad771b4f911e55afb31bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolaj=20=27Eastvillage=27=20=C3=98=20Jensen?= Date: Tue, 22 Oct 2024 21:56:34 +0200 Subject: [PATCH] Add Rect3D and Rect2D and change Color to RGBA (#30) * Add Rect2D and Rect3D * Fix typo * Use screen-space coordinates and sizes * Fix Rect RenderMessage to what is possible * Change color argument order to RGBA * Change Color.a default to 255 --- rendering.fbs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/rendering.fbs b/rendering.fbs index 38b4c95..fc3593e 100644 --- a/rendering.fbs +++ b/rendering.fbs @@ -13,10 +13,10 @@ enum TextVAlign: ubyte { } struct Color { - a:ubyte; r:ubyte; g:ubyte; b:ubyte; + a:ubyte = 255; } table BallAnchor { @@ -52,11 +52,9 @@ table PolyLine3D { table String2D { text:string (required); - /// 0 = Left - /// 1 = Right + /// Screen-space coordinates such that x=0 is left edge and x=1 is right edge of window. x:float; - /// 0 = Top - /// 1 = Bottom + /// Screen-space coordinates such that y=0 is top edge and y=1 is bottom edge of window. y:float; scale:float; foreground:Color (required); @@ -75,11 +73,35 @@ table String3D { v_align:TextVAlign; } +table Rect2D { + /// Screen-space coordinates such that x=0 is left edge and x=1 is right edge of window. + x:float; + /// Screen-space coordinates such that y=0 is top edge and y=1 is bottom edge of window. + y:float; + /// Screen-space size such that width=0.1 is 10% of window width. + width:float; + /// Screen-space size such that height=0.1 is 10% of window height. + height:float; + color:Color (required); + centered:bool; +} + +table Rect3D { + anchor:RenderAnchor (required); + /// Screen-space size such that width=0.1 is 10% of window width. + width:float; + /// Screen-space size such that height=0.1 is 10% of window height. + height:float; + color:Color (required); +} + union RenderType { Line3D, PolyLine3D, String2D, String3D, + Rect2D, + Rect3D, } table RenderMessage {