@@ -137,8 +137,8 @@ def on_key_release(self, k, m ):
137137 def on_mouse_press (self ,x ,y ,button ,modifiers ):
138138 # test from screen coords
139139 print ('on_mouse_press:' )
140- vx , vy = self .scroller .pixel_from_screen (x ,y )
141- print ('\t pixel_from_screen (x, y):' , vx , vy )
140+ vx , vy = self .scroller .screen_to_world (x ,y )
141+ print ('\t screen_to_world (x, y):' , vx , vy )
142142
143143 def clamp (self , actor , new_pos ):
144144 x ,y = new_pos
@@ -182,7 +182,7 @@ def update_after_change(self):
182182
183183 def refresh_marks (self ):
184184 for mark , position in zip (self .scene .marks , self .marks_positions ):
185- screen_pos = self .scroller .pixel_to_screen (* position )
185+ screen_pos = self .scroller .world_to_screen (* position )
186186 mark .position = screen_pos
187187
188188 def teleport_player (self , x , y ):
@@ -220,11 +220,6 @@ def show_common_text():
220220use arrows to move, +- in the main keyboard (not the keypad) for zoom,
221221ctrl-f to toggle fullscreen status.
222222
223- You will need grossinis_sister1.png , to be found in the test directory.
224-
225- You will need cocos r966+ ( for 'cocos_on_resize' event and supresion of
226- NotImplementedError in pixel_to_screen)
227-
228223For clarity set view_width, view_height to respect your desktop aspect
229224ratio; look near the script begin
230225
@@ -253,17 +248,17 @@ def show_mode_1_text():
253248 zoom in or out using key '+' or '-', not so much that all the world shows
254249 in a single screen, then repeat 1), 2)
255250
256- 4. consistency screen to world coordinates conversion(aka pixel_from_screen) :
251+ 4. consistency screen to world coordinates conversion:
257252 a. restart the script, mouse click the inner bottom left corner, do ctrl-f
258253 click again over the inner bottom left corner, zoom a little, click again
259254 over the the inner bottom left corner.
260- Now look at the console: the pixel_from_screen values must all be near a
255+ Now look at the console: the screen_to_world values must all be near a
261256 common value.
262257
263258 b. restart the script, scroll to the top right corner, repeat a. replacing
264259 'botton left' by 'top left'
265260
266- 5. world to screen coordinate changes (aka pixel_to_screen) correctness:
261+ 5. world to screen coordinate changes correctness:
267262 restart the script; move a bit. Look at the lower left corners in the lower
268263 row of squares; you should see a small square in the shades of green.
269264 moving, zomming, resizing (ctrl-f) should not alter the relative position of
@@ -303,17 +298,17 @@ def show_mode_2_text():
303298 zoom in or out using key '+' or '-', not so much that all the world shows
304299 in a single screen, then repeat 1), 2)
305300
306- 4. consistency screen to world coordinates conversion(aka pixel_from_screen) :
301+ 4. consistency screen to world coordinates conversion:
307302 a. restart the script, mouse click the inner bottom left corner, do ctrl-f
308303 click again over the inner bottom left corner, zoom a litle, click again
309304 over the the inner bottom left corner.
310- Now look at the console: the pixel_from_screen values must all be near a
305+ Now look at the console: the screen_to_world values must all be near a
311306 common value.
312307
313308 b. restart the script, scroll to the top right corner, repeat a. replacing
314309 'botton left' by 'top left'
315310
316- 5. world to screen coordinate changes (aka pixel_to_screen) correctness:
311+ 5. world to screen coordinate changes correctness:
317312 restart the script; move a bit. Look at the lower left corners in the lower
318313 row of squares; you should see a small square in the shades of green.
319314 moving, zomming, resizing (ctrl-f) should not alter the relative position of
0 commit comments