New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Measurements from MeasureString #34
Comments
Which version of DirectX Tool Kit are you using? There was a bug with |
I am using: For your additional information: |
The different NuGet packages for DirectX Tool Kit are built for specific platforms, and make different assumptions. If you are writing a "classic" Win32 desktop application, you should not use the For Windows Store 8.1, the application requires Windows 8.1 or later, and so |
In any case I'm able to repro your issue and I'm investigating. |
I think this was a bad fix, but I need to go back and figure out why I needed this change to make other things work. |
Chuck Walbourn, thanks for the explanations. Actually, I am shifting from DirectX9 to DirectX11 and happened to found DirectXTK. At the same time, I am not going to use the legacy SDK (June 2010) to support my game engine even though it is only used for building very simple 2D games. Using DirectXTK makes the conversion easier as I am not very technical or familiar with the Pipeline related knowledge/experience. I do have the intention of converting it to Windows Store App style instead of Win32. However, based on my research, I found that I may also have to pick up C++/CX. So currently, I decided to convert it from DirectX9 (Win32) to DirectX11 (Win32) using DirectXTK first before I further my research on Windows Store App and the Pipeline. This may explains why my 2D Game Engine (Win32) uses Another question aside from As for the SpriteFont, I will wait for you to fix it. |
Hi Chuck, Has the said issue been resolve? |
I'm wrapping a robust fix this weekend. You can download the library and make the source edit yourself as well. |
Ok noted, in that case, i will wait for you to release all the fix at one go. Thanks, |
Sync to the master branch to pick up the fixes. Reverted
Documented on wiki |
Can you roughly estimate when will this fix be pushed to the NuGet Package? |
I generally wait until enough work has accumulated to justify a full release, but I can accelerate a publish to NuGet if that's required. I'll look at doing one this week. |
alright, noted with thanks. |
reminder for NuGet release. Thanks. |
Now that June 2016 is done, I'll be doing all the NuGet publishing for it tomorrow. |
Published to NuGet: This version is also available on NuGet as version 2016.6.30.1 |
yes thanks! |
Hi Chuck, I am getting this error message: "This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is packages\directxtk_windowsstore_8_1.2016.4.26.1\build\native\directxtk_windowsstore_8_1.targets." The solution I had discovered is to remove the lines that contains the April NuGet release. This is what is being removed:
Removing the 200MB package folder (previous releases). Is there a better way to do it rather than editing it manually in the *****.vcxproj? ***EDIT (Other similar issues faced: Some project files do not even mentioned that the DirectXTK NuGet Package was installed. In fact, it was actually installed.) I decided to proceed on to download the NuGet Package again then compile the project. However, it just tells me that the April release was missing. So if anyone faces this problem, you may go ahead and edit out at your own risk. Note: There are some projects files that can be updated successfully without the popup window shown in the above image. |
As I said earlier in this thread, you shouldn't be using |
Hi Developers,
I have notice that the MeasureString returns a wrong size. The string "W" is used to measure the string size. The spritefont file is generated using MakeSpriteFont tool. The font setting is
The returned result for the width and the height are 233 and 283.642578 respectively. "W" is placed at (0,0) I have edited Image 1 to include a black dotted line and marked a red circle to indicate the position where my mouse positioned which reflects the values shown in the Window Title. Clearly, there is a big difference between the Vector2 returned and the size which I had measured.
Image 1:
In addition, when I used SpriteBatch to draw "W" on the screen (0,0) using origin (0,0), it does not draw at the correct place. Instead, there is some sort of spacing as shown in Image 2.
Image 2:
To test it further, I have used SpriteBatch to draw "W" on the screen at the bottom left (i.e. making it right justified) of the screen using the origin calculated via MeasureString, but it does not draw at the correct place as shown in Image 3. Instead, it is lifted and cut off.
Image 3:
The text was updated successfully, but these errors were encountered: