Jump to content

Josmis

Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by Josmis

  1. Ancora c'è molto da fare, a lavoro ultimato posto uno screen!
  2. Perfetto! Ma non continuo a capire il motivo di questo accanimento verso di me...
  3. Cosa avrei fatto per scatenare questa fight?
  4. Ma che bella community italiana che c'è su MTA... come al solito l'italia si fa riconoscere... SEMPRE E COMUNQUE...
  5. Fammi capire... ti credi spiritoso?
  6. Ho risolto! Grazie a tutti lo stesso!
  7. Si beh, alla fine metti caso che uno scripter sa fare tutto ma non un cosa del genere, sbaglio o non è uno scripter completo?
  8. Credo di saper parlare e di capire abbastanza bene l'italiano... Non voglio usare il GUIEDITOR per avere direttamente le coordinate relative! Voglio ricavarle usande guiGetScreenSize()
  9. Josmis

    Dx Drawing

    It wont work! I tryed this code and it works: local distanceBetweenItems = screenX / #items; for i, item in ipairs( items ) do local midPoint = i * distanceBetweenItems; -- center point of the current item local textWidth = dxGetTextWidth( item.text:gsub('#%x%x%x%x%x%x', ''), 1, "bankgothic" ); -- get the text width without colour coding local textHeight = dxGetFontHeight( 1, "bankgothic" ); local left = midPoint - textWidth/2; -- make sure the negative X offset will be half the width of text local top = screenY - textHeight - 15; dxDrawText( item.text, left, top, left - textWidth, top + textHeight, tocolor(0,0,0, alpha), 1, "bankgothic", "center", "center", false, false, false, true); end But it work just for 1280x720!
  10. Fidati, l'ho fatto io. In ogni caso non voglio usare il gui editor, voglio imparare a usare il dxDrawText e company.. (intendo imparare bene a calcolare le coordinate)
  11. Josmis

    Dx Drawing

    @50p Thanks! Finally a detalied explain! Thanks! EDIT: It doesn't work! http://imageshack.us/photo/my-images/856/825n.png/
  12. Ho 5 parole da disegnare nello schermo tramite funzioni Dx, e finora sono riuscito a fare questo: http://imageshack.us/photo/my-images/849/xmhl.png usando questo codice: local screenX,screenY = guiGetScreenSize() local widthRec = screenX local heightRec = 0 local startXrec = 0 local startYrec = screenY local alpha = 0 local offsetY = 90 local offsetX = 90 local startXlbl = 0 local startYlbl = screenY local statsLabelDatas = {text = "#236B8E[#FFFFFFStats#236B8E]", x = startXlbl, y = startYlbl} local shoponeLabelDatas = {text = "#236B8E[#FFFFFFShop #D9D919##FFFFFF1#236B8E]", x = startXlbl, y = startYlbl} local shoptwoLabelDatas = {text = "#236B8E[#FFFFFFShop #D9D919##FFFFFF2#236B8E]", x = startXlbl, y = startYlbl} local rankingLabelDatas = {text = "#236B8E[#FFFFFFRanking#236B8E]", x = startXlbl, y = startYlbl} local settingLabelDatas = {text = "#236B8E[#FFFFFFSettings#236B8E]", x = startXlbl, y = startYlbl} function fadeInGui() heightRec = heightRec - 2 alpha = alpha + 7 if offsetY >= 25 then offsetY = offsetY - 2 offsetX = offsetX - 2 end end function fadeOutGui() heightRec = heightRec + 2 alpha = alpha - 7 if offsetY <= 90 then offsetY = offsetY + 2 offsetX = offsetX + 2 end end function drawDxGuiBase() dxDrawRectangle(startXrec, startYrec, widthRec, heightRec ,tocolor(0,0,0, alpha), false) local items = {statsLabelDatas, shoponeLabelDatas, shoptwoLabelDatas, rankingLabelDatas, settingLabelDatas} local offset = ((screenX-offsetX) / tonumber(#items)) for i=1, #items do if i == #items then dxDrawText ( items[i].text:gsub('#%x%x%x%x%x%x', '') , items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, tocolor(0,0,0, alpha), 1.01, "bankgothic", "center", "center", false, false, false, true) dxDrawText ( items[i].text , items[i].x + (offset*i), items[i].y - offsetY, items[i].x + (offset*i), items[i].y - offsetY, tocolor(0,0,0, alpha), 1, "bankgothic", "center", "center", false, false, false, true) else offset = offset - string.len(items[i+1].text:gsub('#%x%x%x%x%x%x', '')) dxDrawText ( items[i].text:gsub('#%x%x%x%x%x%x', '') , items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, tocolor(0,0,0, alpha), 1.01, "bankgothic", "center", "center", false, false, false, true) dxDrawText ( items[i].text , items[i].x + (offset*i), items[i].y - offsetY, items[i].x + (offset*i), items[i].y - offsetY, tocolor(0,0,0, alpha), 1, "bankgothic", "center", "center", false, false, false, true) end end Però, come potete vedere non sono sparsi nel rettangolo in modo omogeneo, come posso fare ciò?
  13. Josmis

    Dx Drawing

    Did you read my post? .-.
  14. Josmis

    Dx Drawing

    I don't care about this resource, i wont use it, can you help me whit my code?
  15. Josmis

    Dx Drawing

    I don't want it... Anyway, can you help me here? So, i have 5 texts to draw and for now this is what i've done: http://imageshack.us/photo/my-images/849/xmhl.png using this code: local screenX,screenY = guiGetScreenSize() local widthRec = screenX local heightRec = 0 local startXrec = 0 local startYrec = screenY local alpha = 0 local offsetY = 90 local offsetX = 90 local startXlbl = 0 local startYlbl = screenY local statsLabelDatas = {text = "#236B8E[#FFFFFFStats#236B8E]", x = startXlbl, y = startYlbl} local shoponeLabelDatas = {text = "#236B8E[#FFFFFFShop #D9D919##FFFFFF1#236B8E]", x = startXlbl, y = startYlbl} local shoptwoLabelDatas = {text = "#236B8E[#FFFFFFShop #D9D919##FFFFFF2#236B8E]", x = startXlbl, y = startYlbl} local rankingLabelDatas = {text = "#236B8E[#FFFFFFRanking#236B8E]", x = startXlbl, y = startYlbl} local settingLabelDatas = {text = "#236B8E[#FFFFFFSettings#236B8E]", x = startXlbl, y = startYlbl} function fadeInGui() heightRec = heightRec - 2 alpha = alpha + 7 if offsetY >= 25 then offsetY = offsetY - 2 offsetX = offsetX - 2 end end function fadeOutGui() heightRec = heightRec + 2 alpha = alpha - 7 if offsetY <= 90 then offsetY = offsetY + 2 offsetX = offsetX + 2 end end function drawDxGuiBase() dxDrawRectangle(startXrec, startYrec, widthRec, heightRec ,tocolor(0,0,0, alpha), false) local items = {statsLabelDatas, shoponeLabelDatas, shoptwoLabelDatas, rankingLabelDatas, settingLabelDatas} local offset = ((screenX-offsetX) / tonumber(#items)) for i=1, #items do if i == #items then dxDrawText ( items[i].text:gsub('#%x%x%x%x%x%x', '') , items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, tocolor(0,0,0, alpha), 1.01, "bankgothic", "center", "center", false, false, false, true) dxDrawText ( items[i].text , items[i].x + (offset*i), items[i].y - offsetY, items[i].x + (offset*i), items[i].y - offsetY, tocolor(0,0,0, alpha), 1, "bankgothic", "center", "center", false, false, false, true) else offset = offset - string.len(items[i+1].text:gsub('#%x%x%x%x%x%x', '')) dxDrawText ( items[i].text:gsub('#%x%x%x%x%x%x', '') , items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, items[i].x + (offset*i) + 1, items[i].y - offsetY + 1, tocolor(0,0,0, alpha), 1.01, "bankgothic", "center", "center", false, false, false, true) dxDrawText ( items[i].text , items[i].x + (offset*i), items[i].y - offsetY, items[i].x + (offset*i), items[i].y - offsetY, tocolor(0,0,0, alpha), 1, "bankgothic", "center", "center", false, false, false, true) end end But as you can see, in the image the texts are not distributed in all rectangle uniformly, can you help me?
  16. Josmis

    Dx Drawing

    Why you linked me this? .-.
  17. Josmis

    Dx Drawing

    Can someone give me a FULL explain of Absolute and Relative coordinates? I wante make a gui whit Dx Functions, and i need a FULL and a DETAILED explain about them. Thanks!
  18. Post the code, i'm curious
  19. Josmis

    Error alpha

    addEventHandler( "onClientMouseEnter", root, function( ) for key,gui in pairs (buttons) do if source == gui then guiSetAlpha ( gui, 1.0 ) end end end )
  20. Try this: addEventHandler("onClientResourceStart",root, function() triggerServerEvent("onStart",getLocalPlayer()); end)
  21. onClientPlayerWeaponSwitch cancelEvent() Maybe...
  22. If i understood what you want you should try this: local gui = false local isGui = false local guiItems = {"Button", "Checkbox", "Combobox", "Edit field", "Gridlist", "Memo", "Progress bar", "Radio button", "Scrollbar", "Scrollpane", "Static image", "Tab panel", "Tab", "Text label", "Window"} function onFocus() for i, item in ipairs(guiItems) do if source == item then isGui = true break end end end addEventHandler("onClientGUIFocus", root, onFocus, true) function onBlur() isGui = false end addEventHandler("onClientGUIBlur", root, onBlur, true) addEventHandler("onClientClick", getRootElement(), function(button, state, x, y, wx, wy, wz, element) if (button == "left") and (state == "down") then if element and (getElementType(element) == "vehicle") then if not gui then blowVehicle(element) end end end end) Maybe it's the most complicated method to do it (i don't know if it works because i didn't test it) but... try it ahaha
×
×
  • Create New...