This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TexPlay :transparent fail (now fixed) | |
require 'rubygems' | |
require 'common' | |
require 'gosu' | |
require 'texplay' | |
class W < Gosu::Window | |
def initialize | |
super(400, 300, false, 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gosu::Image::as_devil (including workaround for Gosu to_blob colour shift bug) | |
module Gosu | |
class Image | |
def as_devil | |
raise ArgumentError, "Must provide a block" unless block_given? | |
devil_image = Devil.from_blob(Image.from_blob(to_blob, width, height).to_blob, width, height) | |
yield devil_image | |
gosu_image = devil_image.to_gosu $window | |
devil_image.delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def specification(platform) | |
Gem::Specification.new do |s| | |
s.name = "texplay" | |
s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu" | |
s.version = TexPlay::VERSION | |
s.date = Time.now.strftime '%Y-%m-%d' | |
s.author = "John Mair (banisterfiend)" | |
s.email = '[email protected]' | |
s.description = s.summary | |
s.require_path = 'lib' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// slideBulge function | |
// slides the top right menu bulge bg to the left/right to the requested position. | |
function slideBulge(currentPos, endPos) { | |
//stop the slideBulge function (if it is still looping) | |
clearTimeout(bulgeTimeout); | |
//set the jumpSize and jumpSpeed: | |
var jumpSize = 3; | |
var jumpSpeed = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'gosu' | |
n = 1000000 | |
a1 = [1.0, 1.0, 1.0, 1.0] | |
a255 = [255, 255, 255, 255] | |
class Color | |
attr_accessor :red, :blue, :green, :alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto-generated by game7/configure for the Win32 MinGW platform. Do not edit manually. | |
# | |
# Modification History | |
# | |
# 2003-November-2 Jason Rohrer | |
# Created. | |
# | |
# 2003-November-10 Jason Rohrer | |
# Removed pthread flag. | |
# Changed LINUX flag to WIN_32 flag. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Gosu | |
class Color | |
# Setting up for YAML | |
YAML_DOMAIN = 'libgosu.org,2010' | |
YAML_TYPE = 'color' | |
YAML::add_domain_type(YAML_DOMAIN, YAML_TYPE) do |type, value| | |
p type, value | |
Gosu::Color.new(*value[:rgba]) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gosu' | |
include Gosu | |
class Game < Gosu::Window | |
def initialize | |
super 640, 480, false | |
@count = 4 | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require '../lib/remix' | |
require 'bacon' | |
describe 'Test basic remix functionality' do | |
before :each do | |
class Module | |
public :include | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup window components within | |
# Current FXRubyified system managing nesting manually. | |
def setup | |
main_packer = VerticalPacker.new(container, padding: 0) do |packer| | |
label = Label.new(packer, text: "Hello!") | |
10.times do |i| | |
Button.new(packer, text: i.to_s) do |button| | |
button.subscribe :clicked_left_mouse_button do |sender, x, y| | |
label.text = "Pressed #{sender.text.to_i}" | |
end |
OlderNewer