[SOLVED]Change STI object image data in execution

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
AdrianN
Citizen
Posts: 73
Joined: Wed Mar 28, 2018 5:13 pm
Location: Lima

[SOLVED]Change STI object image data in execution

Post by AdrianN »

Hi, I'm trying to connect body box2d with STI (Simple Tiled Implementation) object layers, with my player is simple, using the funcion layer:draw(), but when I tried to move image object, or another object make in tilemap editor in my game (executed), I don´t know any solution for this problem.

I tried to change in the objects table :

Code: Select all

local tierra=self.map.layers["Tierra"] 

for i, obj in ipairs(tierra.objects) do
	obj.rotation=math.pi/5
end
And transform "Tierra" layer to custom layer using this function

Code: Select all

Map:convertToCustomLayer (index)
This function reset all layer's data

But nothing happened, also I previously I found a code to modify the image (tiles and objects), but it's impossible for me to change data such as rotation or x,y axis

Update: I only needing to set more values to change batch position

Code: Select all

instance.batch:set(instance.id, self.map.tiles[instance.gid].quad, instance.x-64,instance.y+64,math.pi/4,4,4,16,16)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 44 guests