Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Problem with bitmap size

Well, these days I was trying to made (parting froms a part of e MACL Library method) a Script for Skew (i´m not sure if that´s the correct word, in spanish is "Sesgar") a Picture. Is the trasnformation to made, for example, a mode7.

And I did this:

Code:
 

  def sesgar_horizontal!(n)

    sesgado = Bitmap.new(width * n, height)

    flip_rect = Rect.new(0, 0, width, 1)

    height.times do |i|

      flip_rect.y = i

      sesgado.blt((i * (n/2)).to_i, i, self, flip_rect)

    end

    clear

    blt(0, 0, sesgado, rect)

    flipped.dispose

  end

 

As you can see, it´s a simple modification of the "Flip" method.

n is how much the image is skewed.

The problem is that, althougt I made wider the Sesgado Bitmap, (coz when the pictures is skewed, it becomes wider)

sesgado = Bitmap.new(width * n, height)

it doesen´t work. And its size remains with the original picture size.

So, the image is skewed, but cut.

I hope someone can help me.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top