Jump to content

thisdp

Scripting Moderators
  • Posts

    535
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by thisdp

  1. Now Combo Box is finished! Plz updatedgs and see the update log : http://angel.mtaip.cn:233/dgsUpdate
  2. function math.quaternion(x, y, z) local rx = math.rad( -x ) local ry = math.rad( -y ) local rz = math.rad( z ) local fCosX = math.cos(rx) local fCosY = math.cos(ry) local fCosZ = math.cos(rz) local fSinX = math.sin(rx) local fSinY = math.sin(ry) local fSinZ = math.sin(rz) local temp1 = fCosY * fCosZ local temp2 = fSinX * fSinY * fSinZ + fCosX * fCosZ local temp3 = fCosX * fCosY local w = math.sqrt(math.max(0.0, 1.0 + temp1 + temp2 + temp3)) * 0.5 local x = math.sqrt(math.max(0.0, 1.0 + temp1 - temp2 - temp3)) * 0.5 local y = math.sqrt(math.max(0.0, 1.0 - temp1 + temp2 - temp3)) * 0.5 local z = math.sqrt(math.max(0.0, 1.0 - temp1 - temp2 + temp3)) * 0.5 x = math.sign(x, (fCosZ * fSinX - fCosX * fSinY * fSinZ) - (-fSinX * fCosY)) y = math.sign(y, fSinY + (fCosX * fSinY * fCosZ + fSinX * fSinZ)) z = math.sign(z, (fSinX * fSinY * fCosZ - fCosX * fSinZ) - (fCosY * fSinZ)) return x, y, z, w end function math.sign(x, a) return (a < 0) and -math.abs(x) or math.abs(x) end This will get a better performance, won't it?
  3. It is now in GitHub. GitHub Source : https://github.com/thisdp/dgs/tree/master
  4. Now I think I fixed it. plz updatedgs and check it.
  5. If the code works more efficiently, I can continue to finish the memo. function getTextIndexFromPosition(text,font,position) local pos = 0 for i=1,utf8.len(text) do local t = utf8.sub(text,i,i) local p = dxGetTextWidth(t,font) if position < pos+0.5*p then return index-1 elseif position < pos+p then return index end pos = pos+p end return false end
  6. OK. I think it is fixed. plz update dgs with "updatedgs".
  7. Got it. Will fix these days. Thanks to report bugs.
  8. I mean the word break. It is the same way to realize text selection and word break. The position means the position like cursor position.
  9. Not so easy. The problem is HOW TO DO rather than the code. Well. If we want to make a memo with dx and without CEF, first thing that we need is the method of text selection. As is known to us all, memo like edit box but it is multi-lined. What I want to do is to deal with the multi line. Text have word break in the original memo. And have text selection. For example, text1 = "Hello everyone, I am thisdp. And I want to make a dx memo." This is a long string. If the memo is not wide enough, the rest text will be shown in the next line. And now the problem appears. How can I know where the text will be break ? If I use dxGetTextWidth with "while/repeat/for" in lua, the performance will be very very low. So I need a function that can get the string index from position
  10. Now you can have your radio button, just update dgs DGS 2.67 has released. See update log: http://angel.mtaip.cn:233/dgsUpdate/
  11. Maybe you enabled your chat box input. If you can't click dgs buttons , can't input something in dgs edit etc, event "onClientClick" shouldn't be working.
  12. soon but i cant make memo.If i use my way to make memo, your client will be very lag.
  13. I need a function such as getTextIndexFromPosition which is in the source code of cegui.
  14. Now I got a big problem with memo. I can hardly deal with newline of memo when the text is out of bounding box ( not the argument in dxDrawText ) which is used to make text selection. And I can't use CEF to replace it because CEF doesn't support IME.
  15. How to render depends on text selection. dxDrawText takes much performance.
  16. I got some problems that memo may use much performance in client.
  17. Good ! But why the smoke and fire will come out from the engine when the vehicle is in the water? I think that if there is any fire on vehicle, when the vehicle is in water, fire should be extinguished.
×
×
  • Create New...