u0u0's Offical Site - Tiled
type: channel
link: http://tyrantek.com/tag/Tiled/
items: Cocos2d-x Tiled 纹理抖动和黑线
items: Tiled 编辑器插件脚本

Cocos2d-x Tiled 纹理抖动和黑线
type: item
date: 2020-12-08T10:16:50+08:00
description: 纹理 texture->setAliasTexParameters() 是可以防止黑线，但是移动地图的时候纹理抖动，并且正常地图依然都移动出现黑线的记录，只是变小了。精灵渲染开fixArtifacts防止黑线，配合纹理的setAntiAliasTexParameters，画面也不会抖动。此方法适用于不缩小的地图。限制摄像机移动？https://blog.csdn.net/gongyiling3468/article/details/47803619/

Tiled 编辑器插件脚本
type: item
date: 2020-05-27T12:47:00+08:00
description: 支持JS脚本插件，存放路径：Windows C:/Users/<USER>/AppData/Local/Tiled/extensions/macOS ~/Library/Preferences/Tiled/extensions/Linux ~/.config/tiled/extensions/示例插件：https://github.com/mapeditor/tiled-extensions官方说明： https://doc.mapeditor.org/en/stable/reference/scripting/插件1，查找object对象:/* * find-object-by-id.js * * This extension adds a 'Find Object by ID' (Ctrl+Shift+F) action to the Map * menu, which can be used to quickly jump to and select an object when you * know its ID. * * The script relies on the recently added TileMap.pixelToScreen conversion * function to work properly for isometric maps. */ function findObjectById(thing, id) { for (let i = thing.layerCount - 1; i >= 0; i--) { const layer = thing.layerAt(i) if (layer.isGroupLayer) { const obj = findObjectById(layer, id) if (obj) return obj } else if (layer.isObjectLayer) { for (const obj of layer.objects) if (obj.id == id) return obj } } return null } let jumpToObject = tiled.registerAction('JumpToObject', function(action) { const map = tiled.activeAsset if (!map.isTileMap) { tiled.alert("Not a tile map!") return } let id = tiled.prompt("Please enter an object ID:") if (id == "") return id = Number(id) const object = findObjectById(map, id) if (!object) { tiled.alert("Failed to find object with ID " + id) return } const pos = map.pixelToScreen ? map.pixelToScreen(object.pos) : object.pos tiled.mapEditor.currentMapView.centerOn(pos.x, pos.y) map.selectedObjects = [object] }) jumpToObject.text = "Find Object by ID" jumpToObject.shortcut = "Ctrl+Shift+F" tiled.extendMenu("Map", [ { separator: true }, { action: "JumpToObject" }, ])插件2，object对象自动对齐，并添加custom属性:/* * AlignObjectToGrid.js */ // if cb return ture, stop walk function walkObjects(root, cb) { for (let i = 0; i < root.layerCount; i++) { const layer = root.layerAt(i) if (layer.isGroupLayer) { if (walkObjects(layer, cb)) return true } else if (layer.isObjectLayer) { if (cb(layer)) return true } } } let jumpToObject = tiled.registerAction('AlignObjectToGrid', functio…