Jump to content

JeViCo

Members
  • Posts

    605
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JeViCo

  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 )
  15. Hi! Try to change your last argument from true to false According to wiki: if set to true after animation the last frame will be frozen, otherwise the animation will end and controls will return
  16. Thank you for mentioning this. I use only 0, 90, 180 & 270 degree rotations so it won't cause problems
  17. Totally forgot about IsInsideColShape function, thank you so much. You saved my day. It solved my problem
  18. Thank you for reply. It works for most objects however it does not when i use narrow objects like this garage door I think that i can use 3-dimensional table for all axis to be 100% sure that objects are not overlapping however i should create 30003 tables to cover the whole map and that's not cool at all. I thought I could solve my problem by using getDistanceBetweenPoints3D, but it all problems comes down to this
  19. You can simplify your getProgress function by using start tick: function getProgress(startTick, time) return (getTickCount() - startTick) / time end -- startTick specifies the starting point -- time - amount of time to use to finish the progress I would recommend you to use metatables to create simultaneous animations
  20. I've recently found out that onClientColshapeHit triggers only when object's center hit the colshape Functions like getElementsWithinColShape and isElementWithinColShape work on the same principle. It's kinda bad because it affects the whole gamemode i make and makes it impossible to complete. I tried to use isLineOfSightClear function however i should use it on each unit of a single object. 9x9x9 object cause performance loss so this is a bad idea. Is there any other ideas?
  21. I wouldn't have thought of it myself. As you would expect from a professional. Your help is invaluable, thank you so much
  22. Is there any way to recreate event that would trigger when the model replacement was finished successfull? My score is to create a small delay between each model replacement. Models consume different amount of time so i can't rely on timers. If i loop through a hundred of models in a row i'll 100% get "not enough memory" error.
  23. Solved. I copied liblua5.1.a library ( /usr/lib/i386-linux-gnu on my device ) next to the Makefile. Also i added -static -L./ flags before the flag -llua5.1 (Makefile)
×
×
  • Create New...