精品导航

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, triangle, and ellipse.
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 program.

random image



There are some variables that might cause some question marks here.
All of these functions have a location, size and color parameters.
The first two parameters for a rectangle are the location of its upper left corner. The next two are its width and height. This means that it will occupy the area on the screen which starts in the coordinates x and y and spread all the way to the x+width and y+height.
Circle, on the other hand, is defined by the location of its center.
X and y represent the center and radius just how far from it are the furthest points.
Triangle is defined by the coordinates of its vertexes. It doesn't matter in which order you put them, every triangle with the same coordinates will look the same.
You can combine those shapes, overlap them, draw them outside of the screen and many more things. Pretty much every more complex shape can be created with the basics ones.

Animations

We already talked about how 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.
For this one, a new block is going to be introduced - a for loop. It's a pretty basic function in programming and you will use it quite often.
This loop and many more can be found in the Loop section, the second one on the list.

random image



What exactly does for loop 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 125, the for loop breaks and the program continues. That means that everything inside it ran 111 times!
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.

Combining text and shapes

Here is a quick example of using both text and shapes at the same time. Both shapes and text can be combined, with one drawn over the other.
Of course, on the top will always be the one whose function was called later in the loop.
In this example, we're recreating our 精品导航 logo by using simple shapes and text.

random image



You can try adding some animations to it and make it come to life!

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