Jump to content

JeViCo

Members
  • Posts

    605
  • Joined

  • Last visited

  • Days Won

    1

JeViCo last won the day on April 21 2018

JeViCo had the most liked content!

3 Followers

Recent Profile Visitors

4,843 profile views

JeViCo's Achievements

Pimp

Pimp (29/54)

102

Reputation

  1. Interesting fact. If browser have some active input with blinking caret, it'll stay there while browser's content will remain invisible. It seems to be a GUI issue. I've managed to solve this issue in a dumb way. To make browser's content visible again you have to make it repaint itself by modifying the HTML contents, so i did this: executeCommandHandler(browser, "document.head.innerHTML = document.head.innerHTML") Keep in mind that your HTML should have head tag or other non important element you can work with.
  2. Steps to reproduce: 1. Execute /createTestBrowser command 2. Try dragging scrollbar Sample code: local function getFakeHtml() iprint("ok") return "<html><body><h2>Hello world<h2></body></html>" end local browser local size = 200 addCommandHandler("createTestBrowser", function() browser = createBrowser(size, size, true, false) setBrowserAjaxHandler(browser, "assets/index.html", getFakeHtml) addEventHandler("onClientBrowserCreated", browser, function () loadBrowserURL(browser, "http://mta/local/assets/index.html") addEventHandler("onClientRender", root, function() dxDrawImage(200, 200, size, size, browser) end) iprint("created") end) end) addEventHandler("onClientResourceStart", resourceRoot, function() local scx, scy = guiGetScreenSize() local width, height = 200, 20 local scroll = guiCreateScrollBar((scx - width)/2, (scy - height)/2, width, height, true, false) showCursor(true) addEventHandler("onClientGUIScroll", scroll, function() local scrollAmount = guiScrollBarGetScrollPosition(scroll) size = 200 + (scrollAmount/100 * 200) resizeBrowser(browser, size, size) end) end)
  3. First of all, browser is created via createBrowser. I've added some in-game settings to adjust browsers's width and height. Changing settings triggers resizeBrowser function with a small delays between calls (100 ms). At some random points browser's content becomes invisible until something happens in browser or it gains a focus. I've tryied to find the issue myself by doing this: 1. Using math.floor on browser size 2. Using sizes that can be devided by two 3. Using different variations of setBrowserRenderingPaused 4. Increasing delays between each call to 1s does nothing 5. Changing blend modes (cuz i'm using webbrowser as material) The only thing that works is recreating the browser over and over again
  4. You're probably looking for a animGroup property in setVehicleHandling function. Wiki says that setting new value is disabled, but you can give it a try. If it doesn't work, replacing original animations is the only option
  5. Hey, what do you think about new IMG functions? Does it solve the long laggy ass replacement process or it's just a wrapper that holds all models and simplifies the bulk replacement process? What about "not enough memory" problem on lower end pcs when you do a bulk model replacement?
  6. setTimer syntax: setTimer(callback_func, timeout_in_ms, times_to_execute, ...callback_args) You can do both things setTimer(setElementPosition, 30*1000, 1, element, x, y, z) -- single action -- equals to setTimer(function() setElementPosition(element, x, y, z) -- other actions here end, 30*1000, 1) These functions may help you: createVehicle, warpPedIntoVehicle, destroyElement
  7. Nah. It seems to be a texture size-related issue Technically we found the solution to the problem of this topic. Thank you for great explanation Texture is stretching somewhere and actual problem hides somewhere deep in the source code. Any furher code-related discussion will be placed on Github
  8. Quick example 1: I drew a whole gta map from scratch all by myself and put a lot of effort into it Quick example 2: I drew a set of unique liveries for vehicles and i don't want them to be anywhere else
  9. I'm not sure that this is the answer i was expecting but still, thanks. I'll probably open an issue on GitHub later on
  10. I'm trying to protect my assets. I don't want to make them public/reusable for someone Is there any way to fix it? Maybe i should preprocess textures idk
  11. Sure https://www.dropbox.com/s/4pjz59zhur3dzfg/info_icon.png I looks OK on 1920x1080 resolution however it looks too bad on higher res
  12. Changing mipmaps or textureEdge arguments doesn't do much (using mipmaps = false & textureEdge = clamp) *click*
  13. Side by side comparsion of 20x20 info icon: *Click here* Example code: local iconPath = "info.png" local f = fileOpen(iconPath) local rawData = fileRead(f, fileGetSize(f)) fileClose(f) local pathTex = dxCreateTexture(iconPath) local rawDataTex = dxCreateTexture(rawData) local size = 20 addEventHandler("onClientRender", root, function() dxDrawImage(0, 0, size, size, pathTex) -- texture created from path (the left one) dxDrawImage(size, 0, size, size, rawDataTex) -- texture created from raw data (the right one) end) Does anyone know how to fix this?
  14. You probably need something like this: function drawStuff( alpha ) local alpha = alpha or 255 local color = tocolor( 255, 255, 255, alpha ) -- draw something end local gAlpha = 0 function fadeExample( ) -- goes from 0 to 255 drawStuff( gAlpha) gAlpha = gAlpha + 0.05 if gAlpha == 255 then removeEventHandler( "onClientRender", root, fadeExample ) end end addEventHandler( "onClientRender", root, fadeExample )
×
×
  • Create New...