Code edit (2 edits merged)
Please save this source code
User prompt
move the dynamix labels to the center of the screen
User prompt
I see no labels yet :(
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'set')' in or related to this line: 'label.anchor.set(1, 0.5);' Line Number: 85
User prompt
place the dynamic labels on the right
User prompt
fiw labels aren't visible
Code edit (2 edits merged)
Please save this source code
User prompt
add dynamic labels on the left of the graph
Code edit (1 edits merged)
Please save this source code
User prompt
Fix : logs "17652VM215:149 Zoom oout from 1 to 0.1"but scaleX never changes
User prompt
Fix : Zoom oout from undefined to 0.1
Code edit (9 edits merged)
Please save this source code
User prompt
before gameover, make a zoom out in order to view the whole graph, with all its segments
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
make markerAxis transparent
Code edit (2 edits merged)
Please save this source code
User prompt
update the line distance = distance; to Adjust distance to ensure segment's end doesn't exeed lowerLimit
Code edit (9 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: lowerLimit is not defined' in or related to this line: 'pointA.y = Math.max(lowerLimit, lastSegmentEndY);' Line Number: 288
User prompt
Fix Bug: 'Timeout.tick error: lowerLimiy is not defined' in or related to this line: 'pointA.y = Math.max(lowerLimiy, lastSegmentEndY);' Line Number: 288
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
in console log "new segment index=..." convert rotation to degrees
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,23 @@
/****
* Classes
****/
+var DynamicLabel = Container.expand(function (value, x, y) {
+ var self = Container.call(this);
+ self.value = value;
+ self.x = x;
+ self.y = y;
+ var label = new Text2(self.value, {
+ size: 30,
+ fill: "#ffffff"
+ });
+ label.anchor.set(1, 0.5);
+ self.addChild(label);
+ self.updateValue = function (newValue) {
+ self.value = newValue;
+ label.setText(self.value);
+ };
+});
var GraphSegment = Container.expand(function () {
var self = Container.call(this);
self.index1 = null;
self.stockValue1 = 0;
@@ -59,8 +75,17 @@
self.drawAxis = function () {
var axisGraphics = self.addChild(LK.getAsset('axis', {
height: 4 // Thin line for the axis
}));
+ if (self.isVertical) {
+ // Add dynamic labels at significant points
+ var labelValues = [0, 50, 100, 150, 200]; // Example values
+ labelValues.forEach(function (value) {
+ var labelY = game.height * 0.75 - value * dollarToYPixelRatio;
+ var label = new DynamicLabel('$' + value, -10, labelY);
+ self.addChild(label);
+ });
+ }
};
});
// ValueIndicator class to represent the current value of the stock on the graph
// Player class to represent the player's portfolio
A Technical dark background. Nothing just a gradiant of colors from black to dark blue. Theme : stock market. background
A modern clean empty rectangular button without borders. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
without shadow
a basic empty ui popup with a black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.