Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Forum
Search
Topic gosu shapes color and design By ryuken Date 2013-02-24 18:21
Thanks :)
Topic gosu shapes color and design By ryuken Date 2013-02-24 17:15
Thanks, the logic for x-size and x+size done it. One more question, is it possible to change the background color of gosu window? or we have only option of image to replace that?

I mean changing color via hex value?
Topic gosu shapes color and design By ryuken Date 2013-02-24 15:16
Yes, I have placed values into that but have to work on the color and also if i am right about placing the methods in draw method()?  or that is wrong?
Topic gosu shapes color and design By ryuken Date 2013-02-24 13:39
I am trying to make some simple shapes in gosu (ruby). I am finding it difficult where to call the functions. Is it update method or the draw method?

also  how do you specify the color to these shapes?

I quickly came up with this code (mind you, i am newbie and learning ruby and gosu)

require 'rubygems'
   require 'gosu'

     class DemoWindow < Gosu::Window
        def initialize
          super(640, 400, false)
        end

        def draw
           draw_quad(x-size, y-size, 0xffffffff, x+size, y-size, 0xffffffff, x-size, y+size, 0xffffffff, x+size, y+size, 0xffffffff, 0)
           draw_triangle(x1, y1, c1, x2, y2, c2, x3, y3, c3, z=0, mode=:default)
           draw_line(x1, y1, c1, x2, y2, c2, z=0, mode=:default)

     end
   end
DemoWindow.new.show

any thoughts? :)

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill