Python Forum
how do i find the canvas location of an object?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i find the canvas location of an object?
#9
Indexing is not fine. Whenever you can make code easier to read without adverse side effects you should do so. a[0] is meaningless to the casual reader, or you when you come back and look at this code a year from now. aleft from ship.bounds is self documenting. Ideally it should be ship_left_bounds, but that makes the collision detection expression really long and I don't think it adds much to understanding.
Reply


Messages In This Thread
RE: how do i find the canvas location of an object? - by deanhystad - Mar-06-2021, 05:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Resizing image inside Canvas (with Canvas' resize) Gupi 2 25,114 Jun-04-2019, 05:05 AM
Last Post: Gupi
  [Tkinter] Problem loading an image from directory into a Canvas object tiotony 3 3,868 Sep-02-2018, 06:47 PM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020