Posts

Showing posts from March, 2018

DroidScript Images

Image
In this post I will speak about images in DroidScript. They are the easiest way to display image files and also for drawing basic shapes like lines, rectangles, ellipses and even other images. The possibilities are endless - you can make image viewers, drawing apps, animations, visualizations, games and even your own controls. Content Load image files Basic Drawing Touch events Animating Image drawing and alias Load image files This is the most common usage of images - displaying. You can't just display png or jpg files - also gif's are possible! //Called when application is started. function OnStart() { //Create a layout with objects vertically centered. var lay = app.CreateLayout( "linear", "VCenter,FillXY" ); //Create png image and add it to layout png = app.CreateImage("/Sys/Img/Hello.png"); lay.AddChild(png); //Create gif image and add it to layout gif = app.CreateImage("/assets/edit