Skip to content

Commit

Permalink
dubs
Browse files Browse the repository at this point in the history
  • Loading branch information
niceEli committed May 17, 2024
1 parent 82199fe commit 1854cf1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
39 changes: 38 additions & 1 deletion src/kLdtkWorlds/campaign/Empty.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"iid": "a26276c0-7820-11ed-b6fd-ed05d55c9a75",
"jsonVersion": "1.5.3",
"appBuildId": 473703,
"nextUid": 228,
"nextUid": 230,
"identifierStyle": "Free",
"toc": [],
"worldLayout": "Free",
Expand Down Expand Up @@ -482,6 +482,43 @@
"allowedRefTags": [],
"tilesetUid": null
},
{
"identifier": "Opacity",
"doc": "This is the opacity of the actor. the lower the more transparent",
"__type": "Float",
"uid": 229,
"type": "F_Float",
"isArray": false,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "ValueOnly",
"editorDisplayScale": 1,
"editorDisplayPos": "Center",
"editorLinkStyle": "StraightArrow",
"editorDisplayColor": null,
"editorAlwaysShow": false,
"editorShowInWorld": true,
"editorCutLongValues": true,
"editorTextSuffix": null,
"editorTextPrefix": "Opacity: ",
"useForSmartColor": false,
"exportToToc": false,
"searchable": false,
"min": 0,
"max": 1,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": { "id": "V_Float", "params": [1] },
"textLanguageMode": null,
"symmetricalRef": false,
"autoChainRef": true,
"allowOutOfLevelRef": true,
"allowedRefs": "OnlySame",
"allowedRefsEntityUid": null,
"allowedRefTags": [],
"tilesetUid": null
},
{
"identifier": "IsStatic",
"doc": "This Will Make The Rectangle Frozen If True But If False Then It Will Act Like Normal",
Expand Down
5 changes: 5 additions & 0 deletions src/kUtils/kLdtkSceneImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ export default async function kLdtkSceneImporter(
case "Player_Start":
break;
case "Phys_Object":
let physObjColor = 1;
if (entValues["Opacity"] !== undefined) {
physObjColor = entValues["Opacity"];
}
let POent = k.add([
k.pos(ent.__worldX * levelsize, ent.__worldY * levelsize),
k.anchor("center"),
Expand All @@ -477,6 +481,7 @@ export default async function kLdtkSceneImporter(
hexToRgb(entValues["Color"]).g,
hexToRgb(entValues["Color"]).b
),
k.opacity(physObjColor),
k.rotate(0),
k.z(300000000),
matterRect(engine, {
Expand Down

0 comments on commit 1854cf1

Please sign in to comment.