View Single Post
05/03/22, 10:44 AM   #8
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
This is the gist of the code:

Code:
	local function AddControl(parent, cType, level)
		local c = WINDOW_MANAGER:CreateControl(nil, parent, cType)
		c:SetDrawLayer(DL_OVERLAY)
		c:SetDrawLevel(level)
		return c
	end

	local anim
	local drag = AddControl(self, CT_TEXTURE, 3)
	drag.label = AddControl(drag, CT_LABEL, 4)

	drag.timeline = ANIMATION_MANAGER:CreateTimeline()
	drag.timeline:SetPlaybackType(ANIMATION_PLAYBACK_LOOP, -1)
	anim = drag.timeline:InsertAnimation(ANIMATION_COLOR, drag.label, 0)

--	anim:SetDuration(750)
If the last line is un-commented the game instantly crashes when the code runs.

I don't think it is related to draw tiers. As you can see the DrawLevel and DrawLayer are being set.

The only scenario I can imagine is that because label has a lower draw level than its parent control it somehow causes problems, but that should really only be that it is visually below the parent and can't be clicked if mouse enabled. I can't see that causing a full game crash.

EDIT: Actually THAT even shouldn't be the case, as I believe draw level works the same as tier and layer in that a higher number means it is displayed higher on the layer stack. So the child having a higher draw layer (being on top) is actually how it should be, if I am understanding correctly?

Last edited by Phinix : 05/03/22 at 11:36 AM.
  Reply With Quote