-
Notifications
You must be signed in to change notification settings - Fork 5
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
updated normal polygon and circle colour #79
Conversation
i just realised this issue doesn't have the help wanted tag, can I still make this PR? |
Of course! import { lab } from 'd3-color';
import { interpolateLab } from 'd3-interpolate';
import { utils } from 'pixi.js';
export const darkSlateGray = 0x121f1f;
lab(
interpolateLab(
utils.hex2string(color),
utils.hex2string(darkSlateGray),
)(0.7),
).formatHex() Can you do it for all the blocks? |
Oh yeah, that's because in game the inside of the block is very dark, and the line around isn't. Here is the formula for the line. export function getLineColor(color) {
return utils.string2hex(
lab(utils.hex2string(color))
.brighter(1.2)
.formatHex(),
);
} You can try adding the line while keeping the dark fill. If adding the line is too complicated, just play around with the |
gotcha, thanks! I've made the updates to the PR. Given that the same formula (originally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa looks very good! 😄
I found a bug: if you click the bouncy block, the selection box doesn't appear.
selection_bug_test_case.json.txt (rename this file to JSON)
I tried playing around with src/components/Polygon.ts
and src/components/SelectionAabb.ts
to understand what's going on, but I found nothing particular 😕. It might be a bug in Pixi, so you can try making a minimal reproduction in pixiplayground (make sure to use the same version of Pixi).
thank you! 😄 I've updated just the syntax for now and will continue investigating the bug. From what I've seen, it seems to be happening when I add the |
@getkey what are the steps you took to trigger the bug? I have tried clearing my level and adding 2 polygons, then exporting them and importing them back in but that works ok for me. I've only been able to replicate the issue by loading in the file you have provided but was wondering what steps were taken to create that particular file. |
This is a Pixi.js bug, which I've reported upstream: pixijs/pixijs#8409. Let's wait until it is resolved in Pixi.js. |
@enjiruuuu I upgraded to the latest Pixi.js, and surely enough the selection bug is gone. 🙂 One remaining problem: the paints get block styles. Example: I'd make a new |
@getkey sweet, thanks for the update! I've made the fix in the recent commit, do let me know if this is what you meant haha incase I misunderstood something 😬 |
Mhh I'm having second thoughts, because I realize now that You can make Polygon more generic. Make it purely about drawing, and move the logic of what to draw higher in the hierarchy. Let it accept:
Then you can make 2 React components: Note: |
Closes #78