WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   UI stops drawing - processing limit/timeout? (https://www.wowinterface.com/forums/showthread.php?t=56027)

corveroth 02-08-18 05:55 PM

UI stops drawing - processing limit/timeout?
 
EDIT: Further fiddling and I've gotten things working, but now I have new questions.

I'm building a grid of pixels, as below. However, if I increase either xsize or ysize to 128, my UI vanishes immediately upon loading in (as if I'd hit Alt-Z to hide the interface, but there seems to be no way to recover). I can alternately avoid this and increase the limits up to 256x256 by commenting out line 16 so that I'm not setting any textures. (Higher limits cause the game to stall for a very long time just loading in.)

Is there some processing limit I'm unaware of?

Lua Code:
  1. Grid = CreateFrame("Frame", "GridFrame", UIParent)
  2. Grid.pixels = {}
  3. Grid:SetPoint("CENTER")
  4.  
  5. local xsize, ysize = 127, 127
  6.  
  7. function MakeGrid()
  8.     Grid:SetSize(xsize, ysize)
  9.     for row = 1, ysize do
  10.         if not Grid.pixels[row] then Grid.pixels[row] = {} end
  11.        
  12.         for column = 1, xsize do
  13.             local t = Grid:CreateTexture()
  14.             t:SetPoint("TOPLEFT", Grid, "TOPLEFT", (row-1), -(column-1))
  15.             t:SetPoint("BOTTOMRIGHT", Grid, "TOPLEFT", row, -column)
  16.             t:SetColorTexture(random(), random(), random(), 1)
  17.             Grid.pixels[row][column] = t
  18.         end
  19.     end
  20. end
  21.  
  22. MakeGrid()

dssd 02-09-18 10:44 PM

I'd guess that you're hitting the vertex or index buffer limit. SetColorTexture will create a texture of that color and would prevent render batching. Instead use SetColorTexture(1, 1, 1, 1) to create a white texture and then use :SetVertexColor to tint them. That should allow everything to be batched.


All times are GMT -6. The time now is 10:54 PM.

vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI