SlideShare a Scribd company logo
Microsoft® Small BasicExploring ShapesEstimated time to complete this lesson: 1 hour
Exploring ShapesIn this lesson, you will learn about:Creating shapes by using the Shapes object.Using various operations of the Shapes object.Animating shapes on the screen.
Introduction to the Shapes ObjectSo far, you have learned to use the GraphicsWindow and the Turtle objects to draw patterns in Small Basic.This lesson introduces you to the Shapes object offered by Small Basic! You can use the Shapes object to add, rotate, and animate the shapes in the graphics window. You can color your shapes by using specific properties of the GraphicsWindow object.
Operations of the Shapes ObjectUsing certain operations of the Shapes object, you can give a vibrant look and feel to the shapes you create. Some of these operations are:AddImage
AddRectangle
HideShape
ShowShape
SetOpacity
GetOpacity
Move
Animate
ZoomOperations of the Shapes ObjectLet’s look at an example to demonstrate these operations…outputIn this example, we have used the ShowShape, HideShape and SetOpacity operations of the Shapes object to perform various actions on the rectangle shape.
Operations of the Shapes ObjectNow let’s understand these operations in detail…HideShape—This operation allows you to hide a shape displayed on the graphics window.ShowShape—This operation allows you to display a shape on the graphics window.AddRectangle—Using this operation, you can draw a rectangle on the graphics window. SetOpacity—You can set the opacity of a shape by using the SetOpacity operation. You must specify the name of the shape and an opacity level from 0 to 100.GetOpacity—This operation gets the opacity of a shape. You must specify the name of the shape as a parameter to this operation.
Operations of the Shapes ObjectLet’s look at another example to demonstrate some more operations…In this example, we have used the AddImageoperation to insert an image on the screen. Next, we have used the Move, Animate and Zoom operations to perform various actions on the image.

More Related Content

PPTX
2.1 graphics window
PPTX
2.2 turtle graphics
PPTX
2.6 flickr, image list, and network objects
PPTX
4.1 playing with shapes
PPTX
4.2 responding to events
PPT
Digital Techniques
PDF
Intro to Dimension
PPT
Modeling and texturing in 3 ds max
2.1 graphics window
2.2 turtle graphics
2.6 flickr, image list, and network objects
4.1 playing with shapes
4.2 responding to events
Digital Techniques
Intro to Dimension
Modeling and texturing in 3 ds max

What's hot (20)

PPT
Max2015 ch01
PPTX
PPT
Facs2930 presentation alex_k
PPTX
4.4 advanced games
PPTX
4.3 collision detection
PPTX
learn sketchup (for the beginners)
PPT
Google sketch up tutorial
PPTX
Digipak creation
PDF
Kodu class
PDF
Animation Title card making
DOC
Production
PDF
Animation introduction
PPTX
3. production experiments(2)
PPTX
Texturemapping
DOCX
Character screenshots
PDF
Sketchup modul
PDF
Plan601 e session 2 demo
PPT
Creating lines in sketchup
PDF
Plan601E Session 2 Demo
PDF
Google sketchup8
Max2015 ch01
Facs2930 presentation alex_k
4.4 advanced games
4.3 collision detection
learn sketchup (for the beginners)
Google sketch up tutorial
Digipak creation
Kodu class
Animation Title card making
Production
Animation introduction
3. production experiments(2)
Texturemapping
Character screenshots
Sketchup modul
Plan601 e session 2 demo
Creating lines in sketchup
Plan601E Session 2 Demo
Google sketchup8
Ad

Viewers also liked (16)

PPTX
1.1 introduction to small basic
PPTX
1.4 conditions and loops
DOCX
Small basic
PPTX
2.5 clock, desktop, and dictionary objects
PPTX
1.3 variables
PPTX
1.5 branching and subroutines
PPTX
2.4 sound, program, and text objects
PPT
Basic logo-command
DOC
In-bai tap logo_01 (hsinh)
PPTX
DOC
Msw logo application user manual for teacher
DOC
In-bai tap logo_02 -thu tuc (hs)
PPT
Logo primitives
DOC
Geometria de las Tortugas
DOC
In-bai tap logo_02 -thu tuc (gv)
PPT
1.1 introduction to small basic
1.4 conditions and loops
Small basic
2.5 clock, desktop, and dictionary objects
1.3 variables
1.5 branching and subroutines
2.4 sound, program, and text objects
Basic logo-command
In-bai tap logo_01 (hsinh)
Msw logo application user manual for teacher
In-bai tap logo_02 -thu tuc (hs)
Logo primitives
Geometria de las Tortugas
In-bai tap logo_02 -thu tuc (gv)
Ad

Similar to 2.3 exploring shapes (20)

PPT
Chapter 13
PPT
VB Lines and Shapes
PPT
Ip lesson3 notes -master
PPTX
Objects and classes in Visual Basic
PPTX
Technology and Livelihood Education IV
PDF
Microsoft PowerPoint Advance Features
PPTX
3.5 the controls object
PPT
VB6_OBJECTS AND GRAPHICS.ppt
PPT
SDN Mentor Hands On - Exercise 2
PPTX
Vb6.0 intro
PPTX
Manupulating arrays
KEY
PowerPoint Lesson 2
PPT
M14 overview
PDF
W4-COMMON-TASK-IN-PUBLISHRRER-SHAPES.pdf
PDF
TASK-IN-PUBLISHER-SHAPES HHHHHHHHHHHHHHH
PPTX
DrawingML Introduction
PPT
DOCX
Word Lesson11 working with shapes
PDF
Microsoft Powerpoint Glossary
Chapter 13
VB Lines and Shapes
Ip lesson3 notes -master
Objects and classes in Visual Basic
Technology and Livelihood Education IV
Microsoft PowerPoint Advance Features
3.5 the controls object
VB6_OBJECTS AND GRAPHICS.ppt
SDN Mentor Hands On - Exercise 2
Vb6.0 intro
Manupulating arrays
PowerPoint Lesson 2
M14 overview
W4-COMMON-TASK-IN-PUBLISHRRER-SHAPES.pdf
TASK-IN-PUBLISHER-SHAPES HHHHHHHHHHHHHHH
DrawingML Introduction
Word Lesson11 working with shapes
Microsoft Powerpoint Glossary

More from allenbailey (7)

PPTX
5.1 sharing code
PPTX
3.6 debugging aids
PPTX
3.4 events and interactivity
PPTX
3.3 the math object
PPTX
3.2 stacks and arrays
PPTX
3.1 file input and output
PPTX
1.2 statements, properties, and operations
5.1 sharing code
3.6 debugging aids
3.4 events and interactivity
3.3 the math object
3.2 stacks and arrays
3.1 file input and output
1.2 statements, properties, and operations

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Getting Started with Data Integration: FME Form 101
PDF
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
Unlocking AI with Model Context Protocol (MCP)
SOPHOS-XG Firewall Administrator PPT.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Getting Started with Data Integration: FME Form 101
Approach and Philosophy of On baking technology

2.3 exploring shapes

  • 1. Microsoft® Small BasicExploring ShapesEstimated time to complete this lesson: 1 hour
  • 2. Exploring ShapesIn this lesson, you will learn about:Creating shapes by using the Shapes object.Using various operations of the Shapes object.Animating shapes on the screen.
  • 3. Introduction to the Shapes ObjectSo far, you have learned to use the GraphicsWindow and the Turtle objects to draw patterns in Small Basic.This lesson introduces you to the Shapes object offered by Small Basic! You can use the Shapes object to add, rotate, and animate the shapes in the graphics window. You can color your shapes by using specific properties of the GraphicsWindow object.
  • 4. Operations of the Shapes ObjectUsing certain operations of the Shapes object, you can give a vibrant look and feel to the shapes you create. Some of these operations are:AddImage
  • 10. Move
  • 12. ZoomOperations of the Shapes ObjectLet’s look at an example to demonstrate these operations…outputIn this example, we have used the ShowShape, HideShape and SetOpacity operations of the Shapes object to perform various actions on the rectangle shape.
  • 13. Operations of the Shapes ObjectNow let’s understand these operations in detail…HideShape—This operation allows you to hide a shape displayed on the graphics window.ShowShape—This operation allows you to display a shape on the graphics window.AddRectangle—Using this operation, you can draw a rectangle on the graphics window. SetOpacity—You can set the opacity of a shape by using the SetOpacity operation. You must specify the name of the shape and an opacity level from 0 to 100.GetOpacity—This operation gets the opacity of a shape. You must specify the name of the shape as a parameter to this operation.
  • 14. Operations of the Shapes ObjectLet’s look at another example to demonstrate some more operations…In this example, we have used the AddImageoperation to insert an image on the screen. Next, we have used the Move, Animate and Zoom operations to perform various actions on the image.
  • 15. Operations of the Shapes ObjectMove—Using this operation, you can set the new location of the shape on the graphics window. You must specify the name of the shape, and the x- and y-coordinates of the new location.Animate—This operation animates a shape to a new position. You must specify the name of the shape, the x- and y-coordinates of the new position, and the duration of the animation.AddImage—Using this operation, you can insert an image on the graphics window. Zoom—The Zoom operation scales a shape by using a particular zoom level. You must specify the name of the shape and select a zoom level between 0.1 and 20.
  • 16. Operations of the Shape ObjectYou can use the Shapes object to add different types of shapes in your program.You can then perform various operations on the Shapes object, such as moving the shape, setting its opacity, or adding a zoom effect. Now, let’s look at an example…Click the button on the toolbar.
  • 17. Animating a ShapeLet’s see an example to animate a shape by using the Shapes object.In this example, you animate a shape from its original position to a new position and back to its original position on the graphics window.
  • 18. Rotating a ShapeLet’s explore some more operations of the Shapes object by writing a program to rotate a shape.outputWhen you execute the program, the rectangle rotates on the graphics window.Click the button on the toolbar.In this example, you use a For loop to rotate a shape along its original position on the graphics window.
  • 19. Fun with ShapesIn addition to drawing shapes of different styles and sizes, you can also create unique shape designs by using conditions and loops in your program.For example, you can use a For loop to create multiple rectangles in random colors…output
  • 20. Let’s Summarize…Congratulations! Now you know how to:Create shapes by using the Shapes object.Use various operations of the Shapes object.Animate the shapes on the screen.
  • 21. It’s Time to Apply Your Learning…Write a program to display a graphics window, and perform the following steps:Add a line and a circle to the graphics window.
  • 22. Set the color, size, and location for the shapes as required.
  • 23. Animate the circle so that it moves from the left side of the graphics window to the right, on top of the line.

Editor's Notes

  • #10: You can create shapes on the screen by using the Shapes object. Take a look at the example on the screen:First, you use the PenWidth, PenColor, and BrushColor properties of the GraphicsWindow object to set the color and width of the pen, and the color of the brush that you use to draw the shapes.In this example, you want to draw two rectangles of the same size, so you use the AddRectangle operation of the Shapes object, and define the parameters for the width and height of the rectangle. You set the location of the rectangles on the graphics window; use the Move operation and define the parameters for the x-coordinate and y-coordinate to where you want the rectangle to move.To set an opacity level for a rectangle, you use the SetOpacity operation with parameters that include the name of the shape and the opacity level.Next, you can zoom a rectangle, by using the Zoom operation. Simply specify the parameters for the name of the shape, and the zoom level on the x-axis and y-axis, respectively. Check the output of your program by clicking the Run button on the toolbar or pressing F5 on the keyboard. Notice the difference between the two rectangles after using operations of the Shapes object on one of the rectangles.Code:GraphicsWindow.Title = "Exploring Shapes"GraphicsWindow.Height = 350GraphicsWindow.Width = 450GraphicsWindow.PenWidth = 2GraphicsWindow.PenColor = "Black"GraphicsWindow.BrushColor = "Purple"rectangle1 = Shapes.AddRectangle(100, 100)Shapes.Move(rectangle1, 50, 80)rectangle2 = Shapes.AddRectangle(100, 100)Shapes.Move(rectangle2, 300, 80) For i = 1 To 4Program.Delay(1000) Shapes.Zoom(rectangle1, i * 0.4, i * 0.4) Shapes.SetOpacity(rectangle1,i * 5)EndFor
  • #13: In addition to drawing shapes of different styles and sizes, you can also create unique shape designs by using conditions and loops in your program. For example, look at the displayed code. You use a For loop to create multiple rectangles, positioned in ascending order by size. You also use the GetRandomColoroperation of the GraphicsWindow object to randomize the color of the rectangles. When you click the Run button on the toolbar or press F5 on the keyboard, the program executes, demonstrating a colorful display of rectangles.Code:GraphicsWindow.Title = "Exploring Shapes"GraphicsWindow.Height = 500GraphicsWindow.Width = 700For i = 0 To 20GraphicsWindow.PenWidth = 0.5GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() rectangle1 = Shapes.AddRectangle(i * 20, i * 10)Shapes.Move(rectangle1, i * 10, i * 10)EndFor
  • #15: Solution: GraphicsWindow.Title = "Exploring Shapes"GraphicsWindow.Height = 200GraphicsWindow.Width = 300 GraphicsWindow.PenColor = "Purple"base = Shapes.AddLine(0, 0, 300, 0)Shapes.Move(base, 0, 100)GraphicsWindow.PenColor = "Black"GraphicsWindow.BrushColor = "Cyan"circle = Shapes.AddEllipse(50, 50)Shapes.Move(circle, 0, 50)Shapes.Animate(circle, 250, 50, 1000)