Currently supports drawing filled circles and rectangles with a border. It works similarly to the SpriteBatch. I tested it on the DesktopGL and WindowsDX platforms. I’m using SDFs which means the shapes should look good at any size.
Very nice thats going to be super handy. Especially when mocking up game ideas without having to load in sprites etc
You should add a draw rectangle overload that rotates the rectangle, altho your input parameter would probably have to be a center location as a well as width and height
True. But also keeping it similar to spritebatch rotation would be nice to where you just pass a float radian in for rotation. But you would need to pass a center vector, width, height and rotation
I successfully incorporated this into my current project by pulling in the nuget package and adding the AposShapesEffect.fx to my Content file.
I was able to draw a red Circle border on top of everything in my main Draw().
However, I see nothing when I try to draw the same Circle to a different RenderTarget inside a SpriteBatch.Begin() … End().
My game draws the main elements to a separate render target which allows zooming in/out etc.
My guess is the circle is always being drawn on the normal render target and thus gets hidden when I finally draw my ‘scene’.
I may dive in to see if this is easy to implement.
UPDATE
I separated the Apos calls out into a separate pass in my game and it works quite nicely now.
Here I am using 3 BorderCircles (red/yellow/red) to highlight units:
Awesome! Looks better because mine has anti-aliasing. It’s a game changer.
Yeah, can’t mix SpriteBatch and ShapeBatch at the same time, have to end one to begin the other. In the future, I’d like to create a “MetaBatch” library that would handle that behind the scene.