Sha256: c52646765953c6a2a4a774cbd187e05046fe607b6acf96339f03853523bd1385

Contents?: true

Size: 672 Bytes

Versions: 11

Compression:

Stored size: 672 Bytes

Contents

module Ashton
  class PixelCache
    # Docs here.

    public
    # Convert the current contents of the cache into a Gosu::Image
    #
    # @option options :caching [Boolean] (true) TexPlay behaviour.
    # @option options :tileable [Boolean] (false) Standard Gosu behaviour.
    def to_image(options = {})
      options = {
          tileable: false,
      }.merge! options

      # Create a new Image from the flipped pixel data.
      stub = ImageStub.new to_blob, width, height
      if defined? TexPlay
        Gosu::Image.new $window, stub, options[:tileable], options
      else
        Gosu::Image.new $window, stub, options[:tileable]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
danabr75-ashton-0.1.5 lib/ashton/pixel_cache.rb
ashton-0.1.6 lib/ashton/pixel_cache.rb
ashton-0.1.5 lib/ashton/pixel_cache.rb
ashton-0.1.4 lib/ashton/pixel_cache.rb
ashton-0.1.3 lib/ashton/pixel_cache.rb
ashton-0.1.2 lib/ashton/pixel_cache.rb
ashton-0.1.1 lib/ashton/pixel_cache.rb
ashton-0.1.0 lib/ashton/pixel_cache.rb
ashton-0.0.4alpha lib/ashton/pixel_cache.rb
ashton-0.0.3alpha lib/ashton/pixel_cache.rb
ashton-0.0.2alpha lib/ashton/pixel_cache.rb