jedbez Posted December 5, 2013 Share Posted December 5, 2013 Есть панелька, в ней указан BackLayer, необходимо програмно заменить его. local wtArrowPanel=form:GetChildChecked( "ArrowPanel", false ) <?xml version="1.0" encoding="UTF-8" ?><WidgetPanel><Name>ArrowPanel</Name><Children></Children><Priority>10</Priority><BackLayer href="empty.(WidgetLayerTiledTexture).xdb#xpointer(/WidgetLayerTiledTexture)" /><Placement><X><Align>WIDGET_ALIGN_CENTER</Align><Size>160</Size></X><Y><Align>WIDGET_ALIGN_LOW</Align><Size>260</Size></Y></Placement><TransparentInput>true</TransparentInput><PickChildrenOnly>true</PickChildrenOnly><Visible>false</Visible></WidgetPanel> empty.(WidgetLayerTiledTexture).xdb <?xml version="1.0" encoding="UTF-8" ?><WidgetLayerTiledTexture><Color>0xffffffff</Color><Grayed>false</Grayed><BlendEffect>BLEND_EFFECT_ALPHABLND</BlendEffect><flatPlacement>false</flatPlacement><lazyLoad>false</lazyLoad><textureItem href="empty.(UISingleTexture).xdb#xpointer(/UISingleTexture)" /><Layout><LeftX>0</LeftX><MiddleX>160</MiddleX><RightX>0</RightX><TopY>0</TopY><MiddleY>260</MiddleY><BottomY>0</BottomY></Layout><layoutTypeX>WIDGET_LAYER_TILED_LAYOUT_TYPE_TILED</layoutTypeX><layoutTypeY>WIDGET_LAYER_TILED_LAYOUT_TYPE_TILED</layoutTypeY></WidgetLayerTiledTexture> Меняю на arrow1.(UISingleTexture) сформированной автоматом local bt=common.GetAddonRelatedTexture("arrow1" )WT:SetBackgroundTexture(bt) <?xml version="1.0" encoding="UTF-8" ?><UITexture><mipSW>-1</mipSW><mipsNumber>1</mipsNumber><generateMipChain>false</generateMipChain><type>DXT5</type><width>256</width><height>512</height><realWidth>160</realWidth><realHeight>260</realHeight><disableLODControl>false</disableLODControl><alphaTex>true</alphaTex><binaryFileSize>17925</binaryFileSize><binaryFile href="arrow1.(UITexture).bin" /><binaryFileSize2>0</binaryFileSize2><binaryFile2 href="" /><sourceFile href="arrow1.tga" /><sourceFileCRC>-196404549</sourceFileCRC><wrap>false</wrap><LocalizationInfo /><atlasPart>true</atlasPart><pool>UNDEFINED</pool></UITexture> и устанавливаю новый размер панели PosXY(WT ,5,90,5,145) И вместо уменьшившегося фона вместе с панелью, получаю, огрызок фона. Где вставить ScaleBackLayer какойнибудь? Quote Link to comment Share on other sites More sharing options...
Slashuur Posted December 5, 2013 Share Posted December 5, 2013 так текстура же WidgetLayerTiledTexture, поэтому и огрызок Quote Link to comment Share on other sites More sharing options...
jedbez Posted December 5, 2013 Author Share Posted December 5, 2013 так текстура же WidgetLayerTiledTexture, поэтому и огрызок Ёмко, с эмоциями и главное всё сразу стало понятно.... Как ни странно это я уже понял, т.е заливать надо тоже WidgetLayerTiledTexture? Почему она не сжалась вместе с панелью? куда смотреть? Quote Link to comment Share on other sites More sharing options...
jedbez Posted December 5, 2013 Author Share Posted December 5, 2013 аааааааааааа всё - дошло, спс WidgetLayerSimpleTexture - решение Quote Link to comment Share on other sites More sharing options...
Setras Posted December 5, 2013 Share Posted December 5, 2013 Simple texture - текстура растягивается. Tiled texture - текстура тайлится (закладывается плитками в родном масштабе в середине оставляя края родного размера) Quote Link to comment Share on other sites More sharing options...
jedbez Posted December 6, 2013 Author Share Posted December 6, 2013 Именно это и хотел услышать. Хотя все равно остался вопрос... это чтож получается Tiled texture растянуть - запросто, а сжать меньше размера текстуры получается никак? Quote Link to comment Share on other sites More sharing options...
Setras Posted December 6, 2013 Share Posted December 6, 2013 Именно это и хотел услышать. Хотя все равно остался вопрос... это чтож получается Tiled texture растянуть - запросто, а сжать меньше размера текстуры получается никак? Почему никак? Вот у тебя пример есть парой постов выше. TiledTexture предназначена для создания фона любого размера, при этом центральная часть картинки будет копироваться много раз. Quote Link to comment Share on other sites More sharing options...
Recommended Posts