12345678910111213141516171819202122232425 |
- function [Ob, Par] = JA_Load_Obj_On_Screen(Par, Ob)
- % it puts on the screen all the objects, in the CURRENT position
- % depending on their nature, different 'Screen' parameters have to be used
- % (FillRect for rectangular objects and FillOval for oval objects)
- objects_names = fieldnames(Ob);
- for x = 1:length(objects_names)
-
- if strcmp(Ob.(objects_names{x}).type, 'square')
- % choose where to put the center of the object by defining its
- % dimensions
- Screen('FillRect', Par.window, Ob.(objects_names{x}).color, Ob.(objects_names{x}).dimension);
- end
-
- if strcmp(Ob.(objects_names{x}).type, 'circle')
- Screen('FillOval', Par.window, Ob.(objects_names{x}).color, Ob.(objects_names{x}).dimension);
- end
-
- end
- end
|