Creating and Moving Shapes in SmallBasic
17 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

How can you add a rectangle to the graphics window using the 'Shapes' object?

  • Rectangle = Shapes.AddRectangle(100,100) (correct)
  • Circle = Shapes.AddCircle(100)
  • Square = Shapes.AddSquare(50,50)
  • Rectangle = Shapes.AddRectangle(50,100)

What does the 'Shapes' object in SmallBasic allow you to do?

  • Change the programming language of shapes
  • Create loops for shapes
  • Animate shapes smoothly
  • Apply modifications to images such as rotation and zooming (correct)

What color is set for the brush before adding a circle using the 'Shapes' object?

  • "red"
  • "blue"
  • "green"
  • "yellow" (correct)

How can you move a shape called 'Circle' to a position (400,300)?

<p>Shapes.Move(Circle, 400,300) (D)</p> Signup and view all the answers

Which object in SmallBasic allows you to perform operations like moving and adding shapes without using loops?

<p>'Shapes' (C)</p> Signup and view all the answers

What happens if you try to use the 'Animate' command with shapes in SmallBasic?

<p>'Animate' command throws an error (B)</p> Signup and view all the answers

What is the purpose of the line 'Shapes.Zoom(rectangle2, i * 0.5, i * 0.5)' in the provided code snippet?

<p>To zoom out on the rectangle (A)</p> Signup and view all the answers

What does the line 'GraphicsWindow.PenWidth = 0.5' in the code snippet indicate?

<p>It sets the width of the pen used for drawing shapes (D)</p> Signup and view all the answers

Why is 'GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()' used in the code snippet?

<p>To determine the color of the brush used for shapes (B)</p> Signup and view all the answers

What is the role of 'Shapes.Move(rectangle1, i * 10, i * 10)' in the provided code?

<p>To change the position of 'rectangle1' (A)</p> Signup and view all the answers

How is the loop 'For i = 0 To 20' utilized in the provided code fragment?

<p>To specify the number of loops for shape creation (D)</p> Signup and view all the answers

What does the code 'Shapes.HideShape(Rectangle)' in the given text do?

<p>Hides the rectangle shape on the graphics window (C)</p> Signup and view all the answers

What is the purpose of the code 'Shapes.Rotate(rotateshape, 30 * i)' in the given text?

<p>Rotates the rectangle shape at 30-degree intervals (D)</p> Signup and view all the answers

What does 'Shapes.SetOpacity(rectangle1, i * 25)' achieve in the code snippet provided?

<p>Changes the opacity of 'rectangle1' in increments of 25 (A)</p> Signup and view all the answers

What is the function of 'Shapes.Zoom(ShapeName, X-level, Y-level)' according to the text?

<p>Zooms the specified shape by adjusting both X and Y levels (D)</p> Signup and view all the answers

What does 'GraphicsWindow.DrawText(20,20i,30i)' do in the provided code snippet?

<p>Draws text showing degree values on the screen along Y-axis (A)</p> Signup and view all the answers

How does 'Shapes.Move(rectangleshape, 50, 80)' affect the rectangle in the text?

<p>'rectangleshape' is moved to position (50, 80) (A)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser