Lufylenged Engine Learning--lgraphics

Source: Internet
Author: User


(a) Draw a picture on a lsprite, and another sprite to make the mask effect of the image, the effect is as follows:

<! DOCTYPE html>

(ii) Comparison of two attribute effects of DrawRect

<! DOCTYPE html>


The effect is as follows:



(iii) Drawing of lines

Init ("Mylegend", 500,350,main), function main () {  


(d) Draw circles, triangles, and quads to fill the plot area with bitmap images.

Linit ("Legend", +, 480, main), function main () {var loader = new Lloader (); Loader.addeventlistener (Levent.complete, Loadbitmapdata); Loader.load ("Face.jpg", "BitmapData");} function Loadbitmapdata (event) {var bitmapdata = new Lbitmapdata (event.target);  var backlayer;backlayer = new Lsprite (); AddChild (Backlayer); BackLayer.graphics.beginBitmapFill (BitmapData); BACKLAYER.GRAPHICS.DRAWARC (1, "#000000", [150,50,50,0,math.pi*2]); backlayer = new Lsprite (); AddChild (Backlayer); BackLayer.graphics.beginBitmapFill (BitmapData); BackLayer.graphics.drawRect (1, "#000000", [10,100,70,100]); Backlayer = new Lsprite (); AddChild (Backlayer); BackLayer.graphics.beginBitmapFill (BitmapData); BackLayer.graphics.drawVertices (1, "#000000", [[120,100],[100,200],[200,150]]);}

DrawVertices plots the coordinate values of the three ∠ points, respectively,

The drawrect draws the coordinate values of the upper-left corner and assigns the value of the width to the high value respectively

BACKLAYER.GRAPHICS.DRAWARC (1, "#000000", [150,100,50,0,math.pi*2]);

150,100 is the circle point coordinates, 50 is the radius, 0, is the starting angle, the math.pi*2 is the end angle






Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Lufylenged Engine Learning--lgraphics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.