`origin` comp making GameObj type inference not working
Version
v2000.1
What browsers are you seeing the problem on?
No response
What happened?
window.origin exists in browser and ts default definitions, which confuses ts with kaboom's own origin(): OriginComp, making game object type inference not working
What's the expected behavior?
window.origin should give kaboom's definition
Minimum reproducable code
// this will be a GameObj<any> instead of a GameObj<PosComp | RectComp | OriginComp>
const thing = add([
pos(120),
rect(80, 40),
origin("center"),
])
Live demo
No response
Is there an existing issue for this?
- [X] I've searched and there is no existing issue for this bug
Chrome
Cannot reproduce
Info: Chrome 84.0.4147.125 OS: Ubuntu 18.04.3 LTS

however....
Visual Studio Code
Can reproduce
Info: Visual Studio Code 1.63.0 OS: Ubuntu 18.04.3 LTS
(VSC removed the type popup when I screenshotted, so here's the typing)

Recomendations:
Rename to originpoint()
Rename to opoint()
Add a propety in all drawble things for use the origin, in TextCompOpt, SpriteCompOpt or RectCompOpt (this reminds me of noArea: boolean xD)
In pos Comp add a option for set the origins
origin as a property in drawable options actually makes a lot of sense, since it's completely tied to the drawables. I'll keep looking for ways to make it work with typescript, if no luck maybe have to resolve into one of these breaking changes
Another issue similar to this: KaboomCtx#focus and HTMLElement#focus, making it when you build Kaboom with typescript, you can't do it.

I think changing the name and avoiding conflict is probably the best way to go.
Some candidates for origin replacement:
pivotoffsetanchor
korigin (kaboom origin) oorigin (object origin) originn (origin no-conflict)
These have a chance of causing more confusion I think 🤔 if we're proceeding with a breaking change might as well make it a normal word
+1
On Sat, Feb 5, 2022 at 8:34 PM tga @.***> wrote:
These have a chance of causing more confusion I think 🤔 if we're proceeding with a breaking change might as well make it a normal word
— Reply to this email directly, view it on GitHub https://github.com/replit/kaboom/issues/451#issuecomment-1030694521, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWDGLBHCFVPJJYA4TZTQEHTUZWCURANCNFSM5JAKZQLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
These have a chance of causing more confusion I think 🤔 if we're proceeding with a breaking change might as well make it a normal word
Oh I was only joking hh
hh sry 😆