Message
Message
// Transparency settings
let FARM_OPACITY = 0.4;
let TS_OPACITY = 1;
let HAT_OPACITY = 1;
// Hitbox settings
const item_radius = {
// Placed objects
trap: 40,
spike: 45,
hard_spike: 45,
big_spike: 42,
boost: 40,
wall: 45,
wood_farm: 80,
wood_farm_cherry: 80,
stone_farm: 60,
bush: 50,
// Held items
trap_item: 40,
spike_item: 45,
hard_spike_item: 45,
big_spike_item: 42,
boost_item: 40,
wall_item: 45,
wood_farm_item: 80,
wood_farm_cherry_item: 80,
stone_farm_item: 60,
berry_farm: 50
};
// Header
const header = document.createElement('div');
header.innerHTML = 'Sploop.io Visual Tools';
header.style.fontWeight = 'bold';
header.style.fontSize = '14px';
header.style.marginBottom = '12px';
header.style.borderBottom = '1px solid rgba(255,255,255,0.2)';
header.style.paddingBottom = '8px';
label.appendChild(valueDisplay);
container.appendChild(label);
container.appendChild(slider);
// Create sliders
const farmSlider = createSlider('Farms/Bushes:', FARM_OPACITY, 'farm-opacity');
const tsSlider = createSlider('Spikes/Traps:', TS_OPACITY, 'ts-opacity');
const hatSlider = createSlider('Hats:', HAT_OPACITY, 'hat-opacity');
// Assemble UI
controlsContainer.appendChild(header);
controlsContainer.appendChild(hitboxToggle);
controlsContainer.appendChild(transparencyHeader);
controlsContainer.appendChild(farmSlider.container);
controlsContainer.appendChild(tsSlider.container);
controlsContainer.appendChild(hatSlider.container);
document.body.appendChild(controlsContainer);
function toggleControlsVisibility() {
controlsVisible = !controlsVisible;
controlsContainer.style.opacity = controlsVisible ? '1' : '0';
controlsContainer.style.pointerEvents = controlsVisible ? 'all' : 'none';
}
isTS = path.includes('spike') ||
path.includes('trap') ||
path.includes('turret') ||
path.includes('bullet');
isHat = path.includes('hat');
}
} catch(e) {}
if (image.src) {
try {
const path = new URL(image.src).pathname;
const isHeldItem = path.includes('/item/');
const object = path.split('/').pop().split('.')[0];
const radius = item_radius[object];
if (radius) {
this.save();
this.beginPath();
this.strokeStyle = hitboxColor;
this.globalAlpha = isHeldItem ? 0.4 : 0.6;
this.lineWidth = 2;