Google Classroom
GeoGebraGeoGebra Classroom

changing the appearance of a point

Introduction

You can change the appearance of a point in a script. Following applets show how to change the size, the color or the style by clicking on a button or by moving a slider.

How do you do this?

Create a point A, whose properties we will change by buttons or sliders.
  • Size by button: Create a button with the script SetPointSize(A,9)to set its size to 9 on clicking.
  • Size by slider: - Create a slider with name size with values from 1 to 9. - Rightclick on the slider to open its Properties and select the tab Scripting. - Type the command SetPointSize(A,size) to change the size of A when moving the slider.
  • Color by button: Create a button with the script SetColor(A, "Red") tot set the color to red on clicking.
  • Color by sliders: - Create sliders red, green and blue from 0 to 1 with increment 0.1 - Open the Properties of the slider red and select the tab Scripting. - Type the command SetColor(A,red, green, blue) to change the color while moving the slider. - Do the same for the sliders green and blue. - Observe how you can create whatever color by while combinating the values of the sliders.
  • Point style: - Create a slider style from 0 to 9 with increment 1. - Open the Properties of the sleder and select the tab Scripting. - Type the command SetPointStyle(A, style) to change the style of A when moving the slider.
  • Button reset: Create a button with following script to reset the settings of A on clicking: SetPointSize(A,5) SetColor(A,"Blue") SetPointStyle(A,0)