2010年10月6日 星期三

HW3


At this class, I learn how to let our view with logo and how to let it not just stay at same place. If we want let logo move, we have to set x1 and y1 to control. If x1 and y1 I set it will be a fix number then the logo will not move. If I want logo move from down to top, y1 should be set like"y1=((y1+5)%(pImg->height-logoImg->height)". But if we want it move from top to down, y1 should be set like "y1=((y1+5)%(pImg->height-logoImg->height)". And the most important thing is that we have to add a limit to avoid logo move out of the range, therefore, we can add "if(y<0) y1="pImg-">height-logoImg->height}" to avoid this kind of situation happend.


沒有留言:

張貼留言