Bulundu Gui arkadesen

Konu sahibinin aradığı materyalleri bulduğu için "Bulundu" öneki eklenmiştir. Eğer aynı materyalleri arıyorsanız yorumlara bakabilirsiniz. İstediğiniz materyallere bu konuda bulamadıysanız yeni konu açabilirsiniz.

Metin2 Mühendisi

Üye
Üye
Mesaj
14
Beğeni
3
Puan
40
Ticaret Puanı
0
1774291553687.webp

gui arkaplan parçalanmış şekilde hazır olan varmı?
 
Çözüm
ui.py:
Genişlet Daralt Kopyala
class BoardDragon(Window):

    CORNER_WIDTH = 32
    CORNER_HEIGHT = 32
    LINE_WIDTH = 128
    LINE_HEIGHT = 128

    BASE_WIDTH = 777
    BASE_HEIGHT = 486

    LT = 0
    LB = 1
    RT = 2
    RB = 3
    L = 0
    R = 1
    T = 2
    B = 3

    def __init__(self):
        Window.__init__(self)
        self.MakeBoard("dragonetc/Board_Corner_", "dragonetc/Board_Line_")
        self.MakeBase()

    def __del__(self):
        Window.__del__(self)

    def MakeBoard(self, cornerPath, linePath):
        CornerFileNames = [ cornerPath+dir+".tga" for dir in ("LeftTop", "LeftBottom", "RightTop", "RightBottom", ) ]
        LineFileNames = [ linePath+dir+".tga" for dir in ("Left", "Right", "Top", "Bottom", ) ]

        self.Corners = []...
Board resim olarak var ama guiler parçalı olduğu için parçalanmış hali olarak önereceğin bir files varmı hocam alıyım ordan
 
ui.py:
Genişlet Daralt Kopyala
class BoardDragon(Window):

    CORNER_WIDTH = 32
    CORNER_HEIGHT = 32
    LINE_WIDTH = 128
    LINE_HEIGHT = 128

    BASE_WIDTH = 777
    BASE_HEIGHT = 486

    LT = 0
    LB = 1
    RT = 2
    RB = 3
    L = 0
    R = 1
    T = 2
    B = 3

    def __init__(self):
        Window.__init__(self)
        self.MakeBoard("dragonetc/Board_Corner_", "dragonetc/Board_Line_")
        self.MakeBase()

    def __del__(self):
        Window.__del__(self)

    def MakeBoard(self, cornerPath, linePath):
        CornerFileNames = [ cornerPath+dir+".tga" for dir in ("LeftTop", "LeftBottom", "RightTop", "RightBottom", ) ]
        LineFileNames = [ linePath+dir+".tga" for dir in ("Left", "Right", "Top", "Bottom", ) ]

        self.Corners = []
        for fileName in CornerFileNames:
            Corner = ExpandedImageBox()
            Corner.AddFlag("not_pick")
            Corner.LoadImage(fileName)
            Corner.SetParent(self)
            Corner.SetPosition(0, 0)
            Corner.Show()
            self.Corners.append(Corner)

        self.Lines = []
        for fileName in LineFileNames:
            Line = ExpandedImageBox()
            Line.AddFlag("not_pick")
            Line.LoadImage(fileName)
            Line.SetParent(self)
            Line.SetPosition(0, 0)
            Line.Show()
            self.Lines.append(Line)

        self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT)
        self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0)

    def MakeBase(self):
        self.Base = ExpandedImageBox()
        self.Base.AddFlag("not_pick")
        self.Base.LoadImage("dragonetc/Board_Base.tga")
        self.Base.SetParent(self)
        self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
        self.Base.Show()

    def HideLine(self, line):
        self.Lines[line].Hide()
        self.SetSize(self.GetWidth(), self.GetHeight())

    def SetSize(self, width, height):

        width = max(self.CORNER_WIDTH*2, width)
        height = max(self.CORNER_HEIGHT*2, height)
        Window.SetSize(self, width, height)

        self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT)
        self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0)
        self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
        self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
        self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)

        verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
        horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH
        self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
        self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
        self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
        self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)

        verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.BASE_HEIGHT) / self.BASE_HEIGHT
        horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.BASE_WIDTH) / self.BASE_WIDTH

        self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)
 

Dosya Eklentileri

Çözüm
Geri
Üst