Dotween Study Notes (ii) Ugui combined use

Source: Internet
Author: User

Ugui Official example is the use of animation to control the movement of the UI, zoom out animation and so on, animation to control the UI animation is too much, so we generally use itween,dotween. To control the animation, so the workload is greatly reduced. Well, let's study Ugui + dotween today.

Ugui for simple movement, magnification, rotation

 Public classMyclass:monobehaviour {voidStart () {image Image= transform. Getcomponent<image>(); //the coordinate system of the domove is the lower left corner, which moves to the 100,100 position.Image.rectTransform.DOMove (NewVector2 ( -, -), 1f); //moves to the current coordinate point x+100, current coordinates y+100Image.rectTransform.DOMove (NewVector2 (image.recttransform.position.x + -, IMAGE.RECTTRANSFORM.POSITION.Y + -), 1f); //current sacle (1,1,1) added to (3,3,1) within 1 secondsImage.rectTransform.DOBlendableScaleBy (NewVector2 (2,2), 1f); //rotate to 180 degreesImage.rectTransform.DORotate (NewVector3 (0,0, the), 1f); }}

Ugui anchor Point and anchoredposition relationship

The coordinates produced by x, Y, and ancharedposition relative to the anchor point. When the plate is writing a joystick UI, the joystick is only in the lower left corner, so the joystick is set to the bottom left, and I assign values to the joystick based on the location of the user tapping the screen input.mouseposition.x and INPUT.MOUSEPOSITION.Y anchoredposition So the function is displayed as normal. but once I was careful, I set the rocker's anchor point to the center of the screen, no matter how I clicked on the joystick in the right position (can you imagine this effect)

Ugui and Dotween for damage text effects

=.= Home in writing

Dotween Study Notes (ii) Ugui combined use

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.