精品导航

Shapes and animations

Shapes and animations

Shapes

There are plenty of blocks that are still unexplained but offer so many different possibilities.
For now, let's focus on ones from the Display section.
We know how to paint the entire screen with one color, but what about only the part of it?
There is a function for drawing some of the most used shapes - rectangle, circle, and line.
All of these can be either filled or not while using the same colors as for the screen.
Here is an example of one such code.

Before we begin, add the "begin nibble variant" block:


The first thing we want to do is fill the screen with white, and put the "Loop forever" block in the drawing section.



Let's draw an outlined rectangle.



We chose a green outline. Both the width and height are set to 25. Also, both coordinates are set to 10.

The color of the rectangle is green.

We'll also draw an outlined circle with a radius of 25 and coordinates of 40 and 70.

The color of the circle is navy.



Click on the Run button and check it out.

Animations

The screen refreshes 25 times in a second, which is fast enough to create the effect of a moving image.
Animations are just that - shapes and images moved so slightly that they have a smooth movement.
It's best that we show it by example.
We're going to take a circle and move it from the top of the screen to the bottom.
When it reaches the bottom, it will change its color and direction in which it moves.


What exactly does "Loop forever" do? It repeats whatever is inside it a specific amount of times.
As we can see in the example, we set the i variable to 15 and increase it by 1 every time the loop loops.
When it gets to 120, the for loop breaks and the program continues.
But what does this exactly have to do with animation? Well, we used that same i as one of the coordinates for the circle.
Every time the loop ran, the circle went down by 1 frame, but the loop ran so fast that we only saw the smooth movement of the circle.

If you want to put the stock firmware back onto your device, you can click the Restore firmware button in the top right corner on CircuitBlocks.

友情链接:汤姆影院 | 蘑菇网页版入口 | 五月丁香 | 老王影院 | tissu-premier.com | 屁屁影院 | 最新av | mogu | 看片神器 | 色婷婷 | 永久地址 | 蘑菇在线观看网页版 | 蘑菇tv网页版 | 永久网站 | 4008108885.com | 小蓝视频 | 日本高清 | 亚洲网 | 资源导航 | 秋霞网 | 亚洲精品 | 在线午夜 | 蘑菇视频入口 | 色啪 | 欧美午夜 | dna0126.com | 四虎影视 | 青草青青 | gzdksw.com | 天天综合 | 迷妹网 | 福利盒子 | 第一福利 | 樱花视频 | 久久久久久 | 午夜在线观看 | rencai98.com | 秋霞影院 | 蜜芽视频 | 小草社区 | 五福影院 | 龙物视频 | 蘑菇影视 | 伊人色 | zpzb2008.com | 扒哥黑料 | 协和影院 | 玖玖资源站 | 蓝色导航 | mogutv | mogu视频 | 琵琶妞 | 在线亚洲 | jxty00.com | 宅男影院 | 福利精品 | mogus.cc | 蘑菇网 | dk99999.com | 久久视频 | 玖玖爱 | 综合影院 | 摩天轮社区 | woqidz.com | 蘑菇短视频入口 | lf397.com | 无名网 | 番号网 | 久久爱 | 老司机视频 | 性知音 | 精品免费 | p站视频 | 蘑菇传媒在线观看 | 色妞 | bt搜索 | 久久香蕉 | 导航大全 | btupic.com | zhuoyemall.com | tsxhyq.com | fltou.com | 六月婷婷 | 草莓视 | 天堂在线 | 青草草 | 蘑菇视频ios | hebeijiaoyuwang.com | 酒色世界 | 青娱 | 超碰视频 | 琳琅导航 | 蘑菇視頻 | 蘑菇传媒 | 红桃视频 | 蘑菇app | sanzhucare-zhpg.com | 青青伊人 | 蘑菇视频网站