interactive-harp
interactive-harp
KPCKevin Powell - Community
Created by interactive-harp on 6/27/2024 in #front-end
Can't center title - horizontally + vertically
solved it, was HTML issue with h1: the whole heading needed to be split into two parts
5 replies
KPCKevin Powell - Community
Created by interactive-harp on 6/27/2024 in #front-end
Can't center title - horizontally + vertically
Tried didn't work lol
5 replies
KPCKevin Powell - Community
Created by interactive-harp on 8/10/2023 in #front-end
unique id - increment object name with 1, 2, 3 and etc
but from the approach I have, I cant access the x and y values
9 replies
KPCKevin Powell - Community
Created by interactive-harp on 8/10/2023 in #front-end
unique id - increment object name with 1, 2, 3 and etc
so on click of the screen/canvas a circle is made. I'm then trying to check in circles x and y coordinates in a distance function to calculate their distance
9 replies
KPCKevin Powell - Community
Created by interactive-harp on 8/10/2023 in #front-end
unique id - increment object name with 1, 2, 3 and etc
okay thanks
9 replies
KPCKevin Powell - Community
Created by interactive-harp on 8/10/2023 in #front-end
unique id - increment object name with 1, 2, 3 and etc
thanks I did something similar:
I tried this: let circle = 0; circle++; const circleID = circle${circle} const circleObj = {x : mouseX, y: mouseY}; circleCoordinates.push({ [circleID] : circleObj });
but I;m not able to access its properties : x and y
9 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
now, its better to turn this into a class right? incase I need to make copies of this object literals arent a good approach to making copies?
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
perfect!
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
floor gets placed into memory, then when floor.createPlane is called it gets the object and all its properties and etc
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
this works
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
const floor = {
width: 3,
height: 3,
textures: '',
color: 0xFF0,
createPlane(){
new PlaneGeometry(this.width, this.height),
new MeshBasicMaterial({ color: this.color }),
console.log(this.width)
},
}
const floor = {
width: 3,
height: 3,
textures: '',
color: 0xFF0,
createPlane(){
new PlaneGeometry(this.width, this.height),
new MeshBasicMaterial({ color: this.color }),
console.log(this.width)
},
}
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
not the floor object
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
because at the time of object initialization this refers to the window object
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
yes makes now, thanks
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
did that originally, now it works lol
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
const floor = { width: 3, height: 3, textures: '', color: 0xFF0, createPlane(){ new PlaneGeometry(this.width, this.height), new MeshBasicMaterial({ color: this.color }), console.log(this.width) }, }
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
testing now
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
makes no sense, same as mine
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
works
44 replies
KPCKevin Powell - Community
Created by interactive-harp on 5/30/2023 in #front-end
arrow function used within an object literal
this is what chatgpt gave me: const floor = { width: 3, height: 3, textures: '', color: 0xFF0, // get createPlane(){ // new PlaneGeometry(this.width, this.heavy), // new MeshBasicMaterial({ color: this.color }) // }, // Function to initialize object properties initialize: function() { this.geometry = new PlaneGeometry(this.width, this.height); this.material = new MeshBasicMaterial({ color: this.color }); this.floor = new Mesh(this.geometry, this.material); } // geometry: new PlaneGeometry(this.width, this.height), // material: new MeshBasicMaterial({ color: this.color }), // floor: new Mesh( geometry, material ), // createFloor: function() // { // console.log(this.width) // } } floor.initialize();
44 replies