I will work on that right now
give me some minutes ^^
@Edit:
To everyone understand the problem here, I'm going to post a brief explanation of the result that I want.
I was trying new stuff, and I came across of this:
self.bitmap.get_pixel(x value, y value)
Well, get_pixel is a method from Bitmap class, an hidden class more exactly. It returns a Color, more or less like:
return Color.new(color[0],color[1],color[2],color[3])
Although, I saw a line in someone's script that had:
self.bitmap.get_pixel(x value, y value).red
After seeing this, I obviously tested, to see the result. The result was the value of the red colour from the pixel with the x and y defined on the previous arguments. I started wondering how the hell, from a bitmap method, I would be able to receive a parameter from another class, in this case from Color class, another hidden class.
The guess from the return of get_pixel was entirely correct, it returned a
Color.new obviously.
After that, it was clearly easy to understand that it was the way of accessing the Color attr readers, which can be red, green, blue and alpha.
When I tried to simulate that process with another bitmap method, I was able to return exactly the values, because they were attr_readers.
Although, I wanted to get further than that, and I began trying to call a method instead of the attr_reader value.
That's where my problems started, it keeps raising an error of NoMethodError.
I already tried to make the method
I want to call, from the class that was returned on the Bitmap method, in different ways...
When I started trying, I thought that I would be able to do it by using 'self.method_from_the_other_class' but didn't work
Basically, the method from bitmap that i created, generates an array that needs to be passed to the other class. Now you say, it can be easily passed by using arguments on the initialize. And this method just needs to return that
class.new(arguments that I need to pass to this class)
Yeah, that's true, but I already tried that, besides, I already deleted all the code over and over again to remake it, so I wouldn't be stacked by trying to find the error. No results at all, always the same error...
Any ideas of how to solve this? xD
@Edit2:
Lol I found the error I guess.
the method I wanna call is 'def alpha=(number)'
I thought by using this I would be able to make a condition, like 'if alpha == 0'
I just know 1 writing method that approaches of that, it is.
def ==(oVal)
if oVal.is_a?(Integer)
#@value is a variable defined in the class where this method is defined
if(oVal == @value)
return true
else
return false
end
end
end
Well, this won't work because @value is set on the damn same class <.<
As this will return true or false due to the value...I'll use 'def method(number)' instead...
Basically, all this mess up was due to my epicness of setting 'nothing' on that method ._.
Anyways, it was worth because I learnt a new thing from array's and the 'wildcard' symbol thing
All taught by ForeverZer0, so thanks a lot