Search the Community
Showing results for tags '3d menu'.
-
Hi, i have source code my menu, how create function at select menu, for example the when will player select at menu, after selection, the function starts. and how to be able to do to let select with mouse or buttons ? sorry for my English, I'm Russian ? My code: local renderTarget = dxCreateRenderTarget( 1000, 1000, true ) local posX, posY, posZ = 14, 0, 2.8 local scroll = 0 local players = { } table.insert( players, { "Лицо" } ) table.insert( players, { "Волосы" } ) table.insert( players, { "Кожа" } ) table.insert( players, { "Одежда" } ) table.insert( players, { "Руки" } ) table.insert( players, { "Ноги" } ) table.insert( players, { "Голова" } ) table.insert( players, { "Лоб" } ) table.insert( players, { "лицо" } ) table.insert( players, { "голова" } ) table.insert( players, { "руки" } ) table.insert( players, { "одежда" } ) table.insert( players, { "пальцы" } ) table.insert( players, { "Лицо" } ) table.insert( players, { "Лицо" } ) function rendermenu() dxSetRenderTarget( renderTarget, true ) local offsetY = 100 for i = 1, #players do local posX, posY, width, height = 0, offsetY - scroll, 970, 80 dxDrawRectangle( posX, posY, width, height, tocolor( 0, 0, 0, 200 ) ) dxDrawText( players[ i ][ 1 ], posX + 30, posY, posX + 30 + width, posY + height, tocolor( 255, 255, 255, 255 ), 3, "default-bold", "left", "center" ) --dxDrawText( players[ i ][ 2 ], posX + ( width - 30 ), posY, posX + ( width - 30 ), posY + height, tocolor( 255, 255, 255, 255 ), 3, "default-bold", "right", "center" ) offsetY = offsetY + 80 end local contentH = #players * 80 local viewableRatio = 900 / contentH local scrollH = 900 * viewableRatio dxDrawRectangle( 970, 100, 30, 900, tocolor( 0, 0, 0, 230 ) ) dxDrawRectangle( 970, 100 + ( scroll * viewableRatio ), 30, scrollH, tocolor( 255, 255, 255, 230 ) ) dxDrawRectangle( 0, 0, 1000, 100, tocolor( 0, 0, 0, 255 ) ) dxDrawText( " Создание персонажа ", 0, 0, 1000, 100, tocolor( 255, 255, 255, 255 ), 5, "default-bold", "center", "center" ) if ( getKeyState( "f4" ) ) then dxSetRenderTarget( myRenderTarget ) end if ( getKeyState( "f2" ) ) then scroll = math.min( scroll + 15, contentH - 900 ) elseif ( getKeyState( "f3" ) ) then scroll = math.max( scroll - 15, 0 ) end dxSetRenderTarget( ) dxDrawMaterialLine3D( posX, posY, posZ + 5, posX, posY, posZ, renderTarget, 5, tocolor( 255, 255, 255, 255 ), 0, 0, 0 ) end addEventHandler( "onClientRender", root,rendermenu)
-
Hi, how to create 3d menu, like in this video https://www.youtube.com/watch?v=mfRrX5LEMrc ? Optional if you can throw off an example ?