i think it depends on the camera position, this code will not work unless the camera's position is at
(x,y,z)
( ScreenWidth/2, distance,-ScreenHeight/2 )
and pointing to
( ScreenWidth/2, 0, -ScreenHeight/2 )
not really sure how to get "distance" variable at the moment, but you can try and see if anything fits
EDIT: i've just seen haliop's post, it might also depend on the object's pivot, if the pivot is in the middle of the object this code will work, or else, you'll have to find it and position it according to the pivot's position, something like what haliop wrote ( haliop's code would work if the pivot is in the corner of the object (maybe GDK's object's pivots are always at the corner? not sure) )