Jump to content

[Solved] need help creating a static animation / hovering Icon


Recommended Posts

in regards to this

I want to add support for custom Icons that will hover over the character depending on his faction. The code is all setup but I don't know how to convert my own Icon into a usable anim.

Right now I'm using someone elses Icons to test my work  D:

could someone point me to a creation tool or a guide?

Edited by Andmann
Link to comment
Share on other sites

well to be concrete:

I want those images to pop up over the heads of any character with a faction.

the way I'm doing that is to create a new prefab which has the respective player as a parent.

function faction:SetFaction(newfaction)
	-- toDo: newfaction type == string?
	self.faction = newfaction
	-- remove icon, else potential crash ^_^
	if self.inst.icon ~= nil then
		self.inst.icon:Remove()
		self.inst.icon = nil
	end
	-- add icon to faction ToDo: add support for any faction
	if self.faction == "blue" or self.faction == "red" then
		self.inst.icon = SpawnPrefab(self.faction.."_faction")
		self.inst.icon.entity:SetParent(self.inst.entity)
		self.inst.icon.Transform:SetPosition(0,3,0)
	end
	TheNet:Announce(self.inst:GetDisplayName().." has changed faction to "..self.faction)
end

 

well this new prefab will of course need some way of showing itself. So i used a static animation from someone else to test everything. and so far it seems perfectly fine. But I struggle with creating my own icons / anim.

I made two samples for testing - attached them ^^

well, I suppose I am doing somewthing wrong with the spriter So I attached the scml project as well and the compilation the game creates from it

 

blue.png

red.png

red_faction.zip

blue_faction.zip

blue_faction.scml

red_faction.scml

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...