Table of Contents

size()

Function Definition: size()

Parameters

Description

The function returns its sprite’s size.

Example

The example demonstrates the bouncing of an object from a bird's eye view in PictoBlox.

Code

sprite = Sprite('Tobi')
import time

sprite.gotoxy(0, 0)
sprite.setsize(100)

while True:
  for i in range(10):
    sprite.changesize(sprite.size()/10)
    time.sleep(0.01)
  for i in range(10):
    sprite.changesize(- sprite.size()/10)
    time.sleep(0.01)

Output

Read More
All articles loaded
No more articles to load