minib3d mojo-commands

Monkey Programming Forums/User Modules/minib3d mojo-commands

Rone(Posted 2013) [#1]

Can you create your own minB3D-mojo topic in modules, and have the correct link to github.



Code is here:
https://github.com/sascha-schmidt217/minib3d-monkey/tree/minib3d.0.33.2/util

Sample:
https://github.com/sascha-schmidt217/minib3d-monkey/blob/minib3d.0.33.2/examples/firepaint2d.monkey

Needs latest minib3d(v66) or my 0.33.2 branch(v67)

Tested on glfw, html5, xna and d3d11. Also added fontmachine...

Please let me know, if errors occur!



I probably missed one or two functions:
format_codebox('
Function B2DInit()
Function B2DEnd()
Function B2DLoadImage:B2DImage( path$,frameCount=1,flags=B2DImage.DefaultFlags)
Function B2DLoadImage:B2DImage( path$,frameWidth,frameHeight,frameCount,flags= B2DImage.DefaultFlags)
Function B2DEndRender()
Function B2DBeginRender()
Function B2DSetBlend( blend )
Function B2DGetBlend()
Function B2DDrawImage( image:B2DImage,x#,y#,frame=0 )
Function B2DDrawImage( image:B2DImage,x#,y#,rotation#,scaleX#,scaleY#,frame=0 )
Function B2DDrawImageRect( image:B2DImage,x#,y#,srcX,srcY,srcWidth,srcHeight,frame=0 )
Function B2DDrawImageRect( image:B2DImage,x#,y#,srcX,srcY,srcWidth,srcHeight,rotation#,scaleX#,scaleY#,frame=0 )
Function B2DDrawTextureRect( texture:TTexture,x#,y#,srcX,srcY,srcWidth,srcHeight)
Function B2DDrawTextureRect( texture:TTexture,x#,y#,srcX,srcY,srcWidth,srcHeight,rotation#,scaleX#,scaleY#)
Function B2DDrawTexture(texture:TTexture, x#, y#)
Function B2DDrawTexture(texture:TTexture, x#, y#, rotation#,scaleX#,scaleY#)
Function B2DDrawRect(x#,y#,width#,height#)
Function B2DDrawLine(x0#,y0#,x1#,y1#, linewidth# = 1 )
Function B2DDrawOval(x#,y#,w#,h#)
Function B2DDrawCircle( x#,y#,r# )
Function B2DSetMatrix( m#[] )
Function B2DSetMatrix( ix#,iy#,jx#,jy#,tx#,ty# )
Function B2DGetMatrix#[]()
Function B2DGetMatrix( matrix#[] )
Function B2DPushMatrix()
Function B2DPopMatrix()
Function B2DTransform( ix#,iy#,jx#,jy#,tx#,ty# )
Function B2DTransform( m#[] )
Function B2DTranslate:Void(x#,y#)
Function B2DScale(sx#,sy#)
Function B2DRotate(angle#)
Function B2DSetColor(r#,g#,b#)
Function B2DGetColor#[]()
Function B2DSetAlpha(a#)
Function B2DGetAlpha#()
Function B2DSetScissor( x#,y#,width#,height# )
Function B2DGetScissor#[]()
Function B2DSetFont( font:B2DImage,firstChar=32 )
Function B2DGetFont:Image()
Function B2DTextWidth#( text$ )
Function B2DTextHeight#()
Function B2DFontHeight#()
Function B2DDrawText( text$,x#,y#,xalign#=0,yalign#=0 )
')


I also created a gui for minib3d. not quite finished yet, will upload in the next days...



FelipeA(Posted 2013) [#2]
This something I was looking for! thanks, I always wanted to use the power of minib3D for 2d games.


frank(Posted 2013) [#3]
GUI looks good! Going almost insane with the fragmented GUIs (and other libraries) for Monkey but in the end choice is good :) Nice work.


julesd(Posted 2013) [#4]
2d canvas
3d canvas
Fonts
GUI
Awesome
almost everything in one place.


Rone(Posted 2013) [#5]
hey, thanks for feedback.
gui is not even finished/released, just ported some junglegui controls and tried to keep it lightweight, cause I needed a gui in minib3d...

I should also point out that the 2d rednering performance is pretty slow compared with mojo(minib3d overhead + slow databuffer on nonm c++ targets)-> it's essential to pack images into atlases.


ImmutableOctet(SKNG)(Posted 2013) [#6]
For the record, there's a typo on line 605 of 'mojo.monkey', B2DGetFont is attempting to return an Image, not a B2DImage. It's a simple fix, but I thought I'd point it out. I'll be happy to report any other errors/typos if I find any. Other than that, this looks great, and I'll be using this if I ever need it.


Rone(Posted 2013) [#7]
thanks...