Skip to content

Conversation

@mariovisic
Copy link
Contributor

Height was being sent rather than the height of a single animation frame in the clip.

Now this example program

require 'ruby2d'

@size = 84

@sprite = Sprite.new('test/media/coin.png',
                     clip_width: @size,
                     clip_height: @size,
                     width: (@size * 1.5),
                     height: (@size * 1.5),
                     color: [0,1,0,1]) #GREEN
update do
end
render do
  @sprite.draw(x: 100,
               y: 100,
               color: [1,0,0,1]) #RED
end

show

Has output which looks correct:

coin direct draw

Height was being sent rather than the height of a single animation frame
in the clip.
@blacktm blacktm merged commit 613e242 into ruby2d:main Jul 21, 2021
@blacktm
Copy link
Member

blacktm commented Jul 21, 2021

Thanks @mariovisic!

@mariovisic mariovisic deleted the fix_sprite_direct_draw_bug branch July 21, 2021 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants