Jump to content
Alloder.pro  about Allods with love 😱
Search In
  • More options...
Find results that contain...
Find results in...

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Digest April

We talk about what was done and updated in the past month. We help keep abreast of events.

Read more

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

Еще раз про текстуры


jedbez
 Share

Recommended Posts

Есть панелька, в ней указан 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  какойнибудь?

 

 

post-698-0-65702900-1386226127_thumb.jpg

Link to comment
Share on other sites

так текстура же WidgetLayerTiledTexture, поэтому и огрызок

Ёмко, с эмоциями и главное всё сразу стало понятно.... :74:

 

Как ни странно это я уже понял, т.е заливать надо тоже WidgetLayerTiledTexture?

Почему она не сжалась вместе с панелью?

 

куда смотреть?

Link to comment
Share on other sites

Simple texture - текстура растягивается.

Tiled texture - текстура тайлится (закладывается плитками в родном масштабе в середине оставляя края родного размера)

Link to comment
Share on other sites

Именно это и хотел услышать.

Хотя все равно остался вопрос... это чтож получается Tiled texture  растянуть - запросто, а сжать меньше размера текстуры получается никак?

Link to comment
Share on other sites

Именно это и хотел услышать.

Хотя все равно остался вопрос... это чтож получается Tiled texture  растянуть - запросто, а сжать меньше размера текстуры получается никак?

Почему никак? Вот у тебя пример есть парой постов выше.

 

TiledTexture  предназначена для создания фона любого размера, при этом центральная часть картинки будет копироваться много раз.

Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use