Closed HakubJozak closed 14 years ago
class Parallax needs to override draw_rot() it gets from GameObject in a simular way it overrides draw(). Two things though:
1) There might be a connection to be made between a viewport and a parallax.. they do share the idea of having a camera/viewport move and change what's displayed accordingly. Maybe there's a really good way of intergrating them.
2) viewport-trait now depends on GameObject#draw_relative to do it's thing. This could become obsolete by using Gosu's new transformations. Then Chingu could wrap up the ordinary draw-calls in translate (x, y, &drawing_code)-block. There's a patch contributed for this but there's a crash to fix before it can be merged.
ad 1) good point, let's think about it ... maybe thinking about class Camera would be a good start
ad 2) different uses of draw_* overloading makes Chingu a little bit harder to extend; I think Parallax should not really be a GameObject, rather BasicGameObject since it does not really need most of the stuff
...I am not working with Parallax for now, so I withdraw my fix offer ;] ... the #draw should become #draw_relative and taky @x,@y into account which it now doesn't. For anyone fixing it, good luck!
The translate patch is not active in master, so this should be a non-issue next gemrelease.
There is a problem when using Parallax and Viewpoint together since Parallax is GameObject but does not have @image set and therefor the draw_relative method fails:
Minimal code reproducing the issue is:
Is there something wrong with my understanding or is it an issue? AFAIK it is not fixed in master branch but I am willing to consult it and commit a fix, please let me know.
thanks
Jakub