Shapes

see Setter functions

PsychExpAPIs.CircleType
Circle()

Constructor for an Circle object

Inputs:

  • win::Window
  • pos::Vector{Int64}
  • rad::Int64 ......radius
  • lineWidth::Int64
  • lineColor::PsychoColor
  • fillColor::PsychoColor
  • fill::Bool ......fill or not

Outputs: None Methods:

  • draw()
  • setLineColor()
  • setFillColor()
  • setPos()
source
PsychExpAPIs.EllipseType
Ellipse()

Constructor for an Ellipse object

Inputs:

  • win::Window
  • pos::Vector{Int64}
  • rx::Int64 ......horizontal radius
  • ry::Int64 ......vertical radius
  • lineWidth::Int64
  • lineColor::PsychoColor
  • fillColor::PsychoColor
  • fill::Bool ......fill or not

Outputs: None Methods:

  • draw
  • setLineColor()
  • setFillColor()
  • setPos()
source
PsychExpAPIs.LineType
Line()

Constructor for a Line object

Constructor inputs:

  • win::Window

  • startPoint::Vector{Int64}

  • endPoint::Vector{Int64}

  • width::Int64

  • lineColor::PsychoColor

Outputs: None

Methods:

  • draw()
source
PsychExpAPIs.PolygonType
Polygon()

Constructor for a regular Polygon object, such as a pentagon or hexagon.

Constructor inputs:

  • win::Window,
  • pos::Vector{Int64}......[x,y] coordinates of center
  • rad::Int64......radius
  • sides::Int64

Optional constructor inputs:

  • units::String......(default is "pixel"
  • lineWidth::Int64......(default is 1)
  • lineColor::PsychoColor......default is (128, 128, 128)

Full list of fields

  • win::Window,
  • pos::Vector{Int64}
  • rad::Int64......radius
  • sides::Int64
  • units::String
  • lineWidth::Int64
  • lineColor::PsychoColor

Methods:

  • draw()
source
PsychExpAPIs.RectType
Rect()

Constructor for a Rect object

Constructor inputs:

  • win::Window,
  • width::Int64
  • height::Int64
  • pos::Vector{Int64} position

Optional constructor inputs:

  • units::String......(default is "pixel"
  • lineWidth::Int64......(default is 1)
  • lineColor::PsychoColor......default is (128, 128, 128)
  • fillColor::PsychoColor......default is (128, 128, 128)
  • ori::Float64 = 0.0......(orientation in degrees)
  • opacity::Float......(default is 1.0, indepenent of alpha)

Full list of fields

  • win::Window
  • width::Int64
  • height::Int64
  • pos::Vector{Int64}
  • units::String
  • lineWidth::Int64
  • lineColor::PsychoColor
  • fillColor::PsychoColor
  • ori::Float64
  • opacity::Int64
  • SDLRect::SDL_Rect

Methods:

  • draw()
  • setLineColor()
  • setFillColor()
  • setPos()
source
PsychExpAPIs.ShapeStimType
ShapeStim()

Constructor for a ShapeStim object, which is a polygon defined by vertices.

Constructor inputs:

  • win::Window,
  • vertices::Vector{Vector{Int64}}

Optional constructor inputs:

  • units::String......(default is "pixel"
  • lineWidth::Int64......(default is 1)
  • lineColor::PsychoColor......default is (128, 128, 128)

Full list of fields

  • win::Window
  • vertices::Vector{Vector{Int64}}

Example: [ [300, 10], [400, 5], [410,150], [320, 100] ,[290, 20] ]

  • units::String
  • lineWidth::Int64
  • lineColor::PsychoColor

Methods:

  • draw()
source

draw(various shape types)

Draws the shape (Line, Rect, Ellipse, TextStim, etc.) into the back buffer.

Example:


	newRect = Rect(myWin, 
			100,			# width
			100, 			# height
			[200,200],		# position
			lineColor = [255,0,0], 
			fillColor = [255,128,128] 
			)
	draw(newRect) 		# in PsychoPy this would have been newRect.draw()

setPos()

Set the position of the object, usually the center unless specified otherwise. Example moves an image rightward by 100 pixels per frame, starting at 300 and ending at 500 pixels:

	for x in 300:100:500
		setPos(myImage, [x, 400])
		draw(myImage)
		waitTime(myWin, 100.0)
		flip(myWin)
	end
See [Setter functions](@ref) for more information.


@index