Skip to content

DrawNode (thickness != 1) is bigger/smaller as expected. What can I do? #2324

Closed Answered by aismann
NgVThangBz asked this question in Q&A
Discussion options

You must be logged in to vote

@NgVThangBz
Some background info: (see also #1411 (comment))

  • GLES2: support glLineWidth => Axmol 1.0
  • GLES3: only support glLineWidth (0~1) => Axmol >=2.0
  • Metal: not support lineWidth

DrawNode 2.0 is supporting thickness again but in a different way.

My proposal after some tests:
There is no "standard" function to get the right factor for the correct thickness (See the "extrem example").

Because of this I think a "Function Pointer" like:void setFactorFunction(float (*funcPtr)()) andsetFactor(yourFactor)method.
If the "default factor = Director::getInstance()->getContentScaleFactor()" not working for your situation you can overwrite the factor method with your own function (your factor …

Replies: 16 comments 16 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@aismann
Comment options

aismann Jan 11, 2025
Collaborator

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@NgVThangBz
Comment options

Comment options

You must be logged in to vote
4 replies
@NgVThangBz
Comment options

@aismann
Comment options

aismann Jan 13, 2025
Collaborator

@NgVThangBz
Comment options

@aismann
Comment options

aismann Jan 14, 2025
Collaborator

Comment options

You must be logged in to vote
8 replies
@aismann
Comment options

aismann Feb 3, 2025
Collaborator

@NgVThangBz
Comment options

@aismann
Comment options

aismann Feb 4, 2025
Collaborator

@NgVThangBz
Comment options

@aismann
Comment options

aismann Feb 4, 2025
Collaborator

Answer selected by aismann
Comment options

You must be logged in to vote
2 replies
@NgVThangBz
Comment options

@aismann
Comment options

aismann Feb 5, 2025
Collaborator

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2322 on January 11, 2025 08:34.