Image draw help?

127 views
Skip to first unread message

Stellarend

unread,
Aug 11, 2016, 2:07:30 PM8/11/16
to DroidScript
So I'm trying to make a really simple 3d engine for droid script and the image.Draw() function seems to be my only option but I literally cannot find any examples of documentation on how to use it other than image.Draw(func, p1, p2, p3...). All help is appreciated. Thanks in advance.

Steve Garman

unread,
Aug 11, 2016, 4:47:46 PM8/11/16
to DroidScript
Image.Draw() itself is not used. I have an idea it is not really useable from JavaScript but I can't remember the details.

The following are all useable

Image.DrawArc ( x1,y1,x2,y2,start,sweep )

Image.DrawCircle ( x,y,radius )

Image.DrawImage ( image,x,y,w,h,angle,mode )

Image.DrawImageMtx ( image,matrix )

Image.DrawLine ( x1,y1,x2,y2 )

Image.DrawPoint ( x,y )

Image.DrawRectangle ( x1,y1,x2,y2 )

Image.DrawText ( txt,x,y )

Stellarend

unread,
Aug 11, 2016, 8:00:23 PM8/11/16
to DroidScript
What would be the best way to create irregular shapes that are filled?

Steve Garman

unread,
Aug 11, 2016, 10:39:06 PM8/11/16
to DroidScript
I don't think app.CreateImage() is going to fulfill your needs.

As soon as you are looking for anything of the sort you describe, people nearly always end up using a WebView with an html canvas.

Very often you will need a third party library too.

If you go down that route, there are lots of libraries out there.

However, in versions of Android older than Lollipop, the WebView is not updated when technology moves on, as browsers are.

You need to test whether the library you use will work on all versions of Android you want to support.

Dave Smart

unread,
Aug 12, 2016, 6:39:17 AM8/12/16
to DroidScript
Since you are talking about 3D, I think you should know that I am working on a PlayCanvas demo for DS and will probably be creating some more materials related to their engine in the future.

One of the reasons I chose them is that they have a free to use world editor and a simple API


Check out this little snippet too:-



Reply all
Reply to author
Forward
0 new messages