Comments (5)
I mean, the documentation says:
DebugPrint draws the string str on the image on left top corner.
There are two possible interpretations of this:
- "[...] 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 isimage.Bounds().Min
. - "[...] 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 ofimage
. So even trying to rewrite as "[...] draws the string onimage
, 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.
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.
I feel like this is an expected behavior.
from ebiten.
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.
Ok so I'd like to update the documentation side.
from ebiten.
Related Issues (20)
- shaderprecomp: add tests
- internal/graphicsdriver/directx, internal/graphicsdriver/metal: use precompiled shader for bulitin shaders
- shaderprecomp: implement for Android
- ebiten: add a new API to return the logical screen size (= the result of Layout) HOT 5
- Feature request: Ability to set the pixel density of the HTML canvas HOT 1
- Weird behaviour when LayoutF returns small sizes, e.g. 1.33,1.00 HOT 8
- Kage: compilation panic on partial function expr
- ebiten: remove `ColorScaleMode`
- all: use iterators wherever possible
- cmd/ebitenmobile: doesn't work with Android SDK 34 HOT 4
- Kage: if-none condition
- .github/workflows: `go vet` fails on the test bot with Go 1.18
- .github/workflows: 32bit Linux test fails
- audio/mp3, audio/vorbis, audio/wav: add `(*Stream).SampleRate()`
- ebiten: cursor position is unexpectedly set to 0,0 after `ebiten.SetCursorMode(ebiten.CursorModeHidden)` HOT 11
- Allow to `FlashWindow` externally HOT 2
- shaderprecomp: remove `ShaderSourceID` HOT 2
- SIGSEGV after the screen turns off with a game running HOT 1
- Performance issue with DrawImage() in game.Draw()
- Vsync not working on some PCs HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebiten.