Many thanks Jeff.

Specification has been modified and pushed to SF GIT branch dev_1.3 with a test 
case:
https://sourceforge.net/p/gnoga/code/ci/dev_1.3/tree/src/gnoga-gui-element-canvas-context_2d-sprite.ads
https://sourceforge.net/p/gnoga/code/ci/dev_1.3/tree/src/gnoga-gui-element-canvas-context_2d-sprite.adb
https://sourceforge.net/p/gnoga/code/ci/dev_1.3/tree/test/sprite_test.adb

This a very preliminary commit:
- memory for saved image on Javascript side is not managed (how to do this?)
- events are not managed (how to do this?)

Any feedbacks are welcome.

Regards, Pascal.
http://blady.pagesperso-orange.fr


> Le 26 nov. 2016 à 22:34, Jeffrey R. Carter <jrcar...@acm.org> a écrit :
> 
> On 11/26/2016 01:07 PM, Pascal wrote:
> 
>>   procedure Create
>>     (Context                       : in out Context_2D_Type;
>>      Sprite                        : in out Sprite_Type'Class;
>>      Image_Data                    : in out Image_Data_Type'Class;
>>      Row, Column                   : in     Integer;
>>      Row_Velocity, Column_Velocity : in     Integer := 0);
>>      --  Defines sprite, specifying the image to draw, the position and the 
>> motion (optionnal)
> 
> How are the position values interpreted? What are the units of velocity?
> 
>> 
>>   procedure Locate
>>     (Sprite      : in out Sprite_Type;
>>      Row, Column : in     Integer);
>>      --  Specifies the position of the upper left hand corner of a sprite
> 
> This probably answers the position question above. Perhaps such information
> should be pulled out into a single comment preceding all the operations.
> 
>> 
>>   procedure Pattern
>>     (Sprite     : in out Sprite_Type;
>>      Image_Data : in out Image_Data_Type'Class);
>>      --  Specifies the image that defines a sprite
>> 
>>   procedure Motion
>>     (Sprite                        : in out Sprite_Type;
>>      Row_Velocity, Column_Velocity : in     Integer);
>>      --  Specifies the motion of a sprite
> The units of velocity question also applies here. As with position, perhaps 
> this
> should be answered in a single comment preceding all the operations.
>> 
>>   function Coincidence
>>     (Sprite1, Sprite2 : in Sprite_Type;
>>      Tolerance        : in Natural)
>>      return Boolean;
>>   function Coincidence
>>     (Sprite      : in Sprite_Type;
>>      Row, Column : in Integer;
>>      Tolerance   : in Natural)
>>      return Boolean;
>>   --  Determines if two sprites or a sprite and a point on the screen at or 
>> near the same location on the screen
> 
> What does it mean for 2 sprites to coincide with a tolerance of zero? For a
> sprite and a point? What are the units of tolerance?
> 
>> 
>>   function Distance
>>     (Sprite1, Sprite2 : in Sprite_Type)
>>      return Natural;
>>   function Distance
>>     (Sprite      : in Sprite_Type;
>>      Row, Column : in Integer)
>>      return Natural;
>>   --  Determines the distance between two sprites or a sprite and a location
>>   --  The result is the square root between the upper left hand corner of 
>> two sprites
>>   --  or between the upper left hand corner of a sprite and a location
> Since distances are often fractional, should these return a real type?
>> 
>>   procedure Position
>>     (Sprite      : in     Sprite_Type;
>>      Row, Column :    out Integer);
>>      --  Determines the position of a sprite
> 
> For completeness, should there be query operations for the image and 
> velocities?
> 
>> 
>>   procedure Del_Sprite (Sprite : in out Sprite_Type);
>>   procedure Del_Sprite_All;
>>   --  Deletes sprites
> 
> I think Delete and Delete_All would be better names for these.
> 
> -- 
> Jeff Carter
> "Hold your temper. Count ten.... Now let 'er go.
> You got a good aim."
> Never Give a Sucker an Even Break
> 105
> 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Gnoga-list mailing list
> Gnoga-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gnoga-list


------------------------------------------------------------------------------
_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to