久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <i id='nlvdn'><tr id='nlvdn'><dt id='nlvdn'><q id='nlvdn'><span id='nlvdn'><b id='nlvdn'><form id='nlvdn'><ins id='nlvdn'></ins><ul id='nlvdn'></ul><sub id='nlvdn'></sub></form><legend id='nlvdn'></legend><bdo id='nlvdn'><pre id='nlvdn'><center id='nlvdn'></center></pre></bdo></b><th id='nlvdn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nlvdn'><tfoot id='nlvdn'></tfoot><dl id='nlvdn'><fieldset id='nlvdn'></fieldset></dl></div>
  • <legend id='nlvdn'><style id='nlvdn'><dir id='nlvdn'><q id='nlvdn'></q></dir></style></legend>

      <small id='nlvdn'></small><noframes id='nlvdn'>

      1. <tfoot id='nlvdn'></tfoot>
          <bdo id='nlvdn'></bdo><ul id='nlvdn'></ul>

        將文本渲染到 kivy 畫布

        Rendering text to a kivy canvas(將文本渲染到 kivy 畫布)
        <tfoot id='puz93'></tfoot>

        <legend id='puz93'><style id='puz93'><dir id='puz93'><q id='puz93'></q></dir></style></legend>

          <small id='puz93'></small><noframes id='puz93'>

          <i id='puz93'><tr id='puz93'><dt id='puz93'><q id='puz93'><span id='puz93'><b id='puz93'><form id='puz93'><ins id='puz93'></ins><ul id='puz93'></ul><sub id='puz93'></sub></form><legend id='puz93'></legend><bdo id='puz93'><pre id='puz93'><center id='puz93'></center></pre></bdo></b><th id='puz93'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='puz93'><tfoot id='puz93'></tfoot><dl id='puz93'><fieldset id='puz93'></fieldset></dl></div>

            <bdo id='puz93'></bdo><ul id='puz93'></ul>
                  <tbody id='puz93'></tbody>
                1. 本文介紹了將文本渲染到 kivy 畫布的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試在 kivy 的畫布"中繪制自己的圖形.現在我有一個每秒改變一次顏色的紅色或綠色矩形,但我想添加一個不斷變化的文本標簽.

                  I am trying to draw my own graphic within a kivy 'canvas'. For now I have a red or green rectangle which changes colour once per second, but I want to add a changing text label.

                  經過一番搜索,似乎沒有可以添加到畫布的文本"指令.我發現了一些關于使用 Label() 小部件以及畫布說明的參考,但這似乎并不理想,而且我似乎無法讓它多次渲染.

                  After a little searching it appears that there isn't a "Text" Instruction which can be added to the canvas. I have found a few references to using a Label() widget as well as the canvas Instructions, but this does not seem ideal, and also I can't seem to get it to render more than once.

                  這是我目前的對象:

                  class HVObject(BoxLayout):
                      def __init__(self, **kwargs):
                          BoxLayout.__init__(self, **kwargs)
                          self.colour = 1
                          self.label = Label()
                          self.render()
                          self.add_widget(self.label)
                  
                          self.bind(size=self._update_rect, pos=self._update_rect)
                          Clock.schedule_interval(self.callevery, 1)
                  
                      def render(self):
                          self.canvas.clear()
                          self.rect = Rectangle(size=self.size, pos=self.pos)
                          self.canvas.add(Color(1-self.colour, self.colour, 0, 1))
                          self.canvas.add(self.rect)
                          self.label.text = "COL %d" % self.colour
                          self.canvas.ask_update()
                  
                      def callevery(self, x):
                          self.colour = 1-self.colour
                          self.render()
                  
                      def _update_rect(self, instance, value):
                          self.rect.pos = instance.pos
                          self.rect.size = instance.size
                          self.label.pos = instance.pos
                  

                  有沒有簡單的方法可以達到我需要的效果?

                  Is there an easy way to achieve the effect I need?

                  謝謝

                  推薦答案

                  回答我自己的問題:

                  在 [kivy] 花園周圍看了一圈后,我找到了 Tickline(和 Tick).以及 CoreLabel() 和 Rectangle(texture=...) 的使用

                  After a little look around the [kivy] garden, I found Tickline (and Tick). and the use of CoreLabel() and Rectangle(texture=...)

                  這是我更新的 render() 方法,它添加了我需要的文本對象.

                  Here's my updated render() method which adds the text object I need.

                      def render(self):
                          self.canvas.clear()
                          self.canvas.add(Color(1-self.colour, self.colour, 0, 1))
                          self.rect = Rectangle(size=self.size, pos=self.pos)
                          self.canvas.add(self.rect)
                          label = CoreLabel(text="COL %d" % self.colour, font_size=20)
                          label.refresh()
                          text = label.texture
                          self.canvas.add(Color(self.colour, 1-self.colour,0, 1))
                          pos = list(self.pos[i] + (self.size[i] - text.size[i]) / 2 for i in range(2))
                          self.canvas.add(Rectangle(size=text.size, pos=pos, texture=text))
                          self.canvas.ask_update()
                  

                  這對我有用,雖然有點笨重!

                  Which works for me, albeit a little clunky!

                  這篇關于將文本渲染到 kivy 畫布的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                  <legend id='2ntLL'><style id='2ntLL'><dir id='2ntLL'><q id='2ntLL'></q></dir></style></legend>

                    • <bdo id='2ntLL'></bdo><ul id='2ntLL'></ul>

                      <small id='2ntLL'></small><noframes id='2ntLL'>

                        • <i id='2ntLL'><tr id='2ntLL'><dt id='2ntLL'><q id='2ntLL'><span id='2ntLL'><b id='2ntLL'><form id='2ntLL'><ins id='2ntLL'></ins><ul id='2ntLL'></ul><sub id='2ntLL'></sub></form><legend id='2ntLL'></legend><bdo id='2ntLL'><pre id='2ntLL'><center id='2ntLL'></center></pre></bdo></b><th id='2ntLL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2ntLL'><tfoot id='2ntLL'></tfoot><dl id='2ntLL'><fieldset id='2ntLL'></fieldset></dl></div>
                        • <tfoot id='2ntLL'></tfoot>
                            <tbody id='2ntLL'></tbody>
                            主站蜘蛛池模板: 在线观看国产精品视频 | 黄色免费在线观看网址 | 91精品国产色综合久久不卡98 | 亚洲一区二区在线视频 | 精品三级在线观看 | 国产亚洲精品久久久优势 | 日韩在线播放网址 | 免费观看羞羞视频网站 | 日韩一区二 | 亚洲欧美一区二区三区国产精品 | 精品久久久久久久久久 | 天天艹天天干天天 | 中文字幕av网站 | 精品一区二区不卡 | 欧美成年人视频在线观看 | 成人一区av偷拍 | 欧美一区二区大片 | www.久| 国产精品高清一区二区 | 91资源在线观看 | 亚洲久草视频 | 国产成人精品一区二三区在线观看 | 亚洲综合视频 | 91亚洲精品国偷拍自产在线观看 | 国内91在线 | 激情欧美一区二区三区中文字幕 | 成人午夜影院 | 手机av在线| 国产亚洲精品久久久久动 | 日本精品一区二区三区在线观看视频 | 亚洲a在线视频 | 久久综合久久综合久久 | 欧美精品综合在线 | 欧美在线一区二区视频 | 少妇特黄a一区二区三区88av | 国产一区高清 | 亚洲电影一区二区三区 | 欧美日韩中文字幕在线播放 | 国产日韩精品久久 | 久久国产精品一区二区 | 国产精品一区二区三 |