GithubHelp home page GithubHelp logo

Comments (5)

tinne26 avatar tinne26 commented on June 1, 2024 1

I mean, the documentation says:

DebugPrint draws the string str on the image on left top corner.

There are two possible interpretations of this:

  1. "[...] draws the string on image's top-left corner", in which case, top-left corner is the image's origin, and the function description doesn't match its current behavior, as an image origin is image.Bounds().Min.
  2. "[...] draws the string on image, at coordinates (0, 0)", in which case, the current documentation is very ambiguous and easy to misinterpret. Notice that (0, 0) is not even the top-left corner of the screen, but technically, the top-left corner of the parent of image. So even trying to rewrite as "[...] draws the string on image, on the top-left corner of the screen" wouldn't be technically correct. An alternative description would be "with no translation".

I'm fine with current behavior being the desired one, but I don't think the most reasonable interpretation of the function description matches the current behavior.

Regarding Zyko's comment, DrawImage() doesn't have this problem, and in fact, you depend on GeoM, which has this explicit documentation:

// The default (zero) value is identity, which draws the image at (0, 0).

So, I think there is no parallel with DrawImage() here, this is purely on DebugPrint()'s description / behavior mismatch.

from ebiten.

tinne26 avatar tinne26 commented on June 1, 2024

I mean, I'm unsure of the exact desired behaviors, in some cases DebugPrintAt() might also need some changes, in which case the fix would be more involved?

from ebiten.

hajimehoshi avatar hajimehoshi commented on June 1, 2024

I feel like this is an expected behavior.

from ebiten.

Zyko0 avatar Zyko0 commented on June 1, 2024

I feel like this is an expected behavior.

Yes, I think it's for the same reason that if you do DrawImage to a sub-image, you also have to translate the origin of the destination sub-image explicitely.

edit: maybe this is not really desirable (?) but at least it seems consistent with the other API behaviours regarding sub-images

from ebiten.

hajimehoshi avatar hajimehoshi commented on June 1, 2024

Ok so I'd like to update the documentation side.

from ebiten.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.