• Benvenuto in Making Videogames!
  • Dai sfogo alla tua fantasia!
  • Crea il tuo Videogioco!
Benvenuto ospite! Login Registrati




Valutazione discussione:
  • 0 voto(i) - 0 media
  • 1
  • 2
  • 3
  • 4
  • 5
Player piccolo, piccolo
#1
Salve, volevo chiedervi come potevo fare a rimpicciolire i player.
Per capirci meglio, ho creato una stanza, voglio fare in modo che i giocatori si muovano in questa stanza come fossero della grandezza di una formica.
Ovviamente ho gia provato a rimpicciolire con il ridimensionamento standard di Unity, ma non basta, rimane comunque troppo grande, e se ingrandisco ulteriormente la stanza, questa sparisce dalla scena.
Qualche idea?
Grazie in anticipo ^^
 
Rispondi
#2
Prova cosi
Codice:
function ResizeUnity()

    {

        //This function properly assigns innerWidth and Height to winWidth and winHeight

        GetWindowSize();



        var unity = document.getElementById('unityPlayer');

        if(unity != null)

            {                  

                unity.style.width = winWidth + "px";

                unity.style.height = winHeight + "px";

            }

    }
 
Rispondi
#3
(07-12-2012, 12:56 PM)Exorcist Ha scritto: Prova cosi
Codice:
function ResizeUnity()

    {

        //This function properly assigns innerWidth and Height to winWidth and winHeight

        GetWindowSize();



        var unity = document.getElementById('unityPlayer');

        if(unity != null)

            {                  

                unity.style.width = winWidth + "px";

                unity.style.height = winHeight + "px";

            }

    }


Intanto grazie mille per la risposta rapida, molto gentile.
Ti chiedo se puoi perdonare la mia ignoranza, ma lo script a cosa lo assegno?
E ancora uan doamnda se mi è permesso. Come faccio ad aumentare langolo di visualizazione in lontananza? ( il limite di dove puo vedere il player per intenderci)
Grazie ancora, molto gentile ^^

(07-12-2012, 02:01 PM)Kuroko Ha scritto:
(07-12-2012, 12:56 PM)Exorcist Ha scritto: Prova cosi
Codice:
function ResizeUnity()

    {

        //This function properly assigns innerWidth and Height to winWidth and winHeight

        GetWindowSize();



        var unity = document.getElementById('unityPlayer');

        if(unity != null)

            {                  

                unity.style.width = winWidth + "px";

                unity.style.height = winHeight + "px";

            }

    }


Intanto grazie mille per la risposta rapida, molto gentile.
Ti chiedo se puoi perdonare la mia ignoranza, ma lo script a cosa lo assegno?
E ancora uan doamnda se mi è permesso. Come faccio ad aumentare langolo di visualizazione in lontananza? ( il limite di dove puo vedere il player per intenderci)
Grazie ancora, molto gentile ^^

Ok, credo daver capito che lo script non devo assegnarlo a nessun oggetto. Pero mi da 4 errori:

Assets/(Z) CAnttina/Script/Resising.js(7,9): BCE0005: Unknown identifier: 'GetWindowSize'.

Assets/(Z) CAnttina/Script/Resising.js(11,21): BCE0005: Unknown identifier: 'document'.

Assets/(Z) CAnttina/Script/Resising.js(17,37): BCE0005: Unknown identifier: 'winWidth'

Assets/(Z) CAnttina/Script/Resising.js(19,38): BCE0005: Unknown identifier: 'winHeight'.
 
Rispondi
#4
Ciao scusa la tarda risposta:
dove sto leggendo io un utente manda questo codice che gli da questi errori:
From various alert()s in the code, I can verify that ResizeUnity() is being called when I change the size of the window. I can verify that winWidth and winHeight are getting proper values assigned to them upon resizing. But, no matter what I do to the browser window, the Unity WebPlayer object stays the same size it was when it was loaded.

Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<
html xmlns="http://www.w3.org/1999/xhtml">

    <
head>

       <
script type="text/javascript">

       <!--

       function 
GetUnity() 

       {

         if (
typeof unityObject != "undefined"

         {

          return 
unityObject.getObjectById("unityPlayer");

         }

         return 
null;

       }

 

       function 
ResizeUnity()

       {

         
//This function properly assigns innerWidth and Height to winWidth and winHeight

         
GetWindowSize();

 

         var 
unity GetUnity();

         if(
unity != null)

         {

          
//This does not properly resize anything at all

          
unity.width winWidth;

          
unity.height winHeight;

         }

       }

    }

 

    if (
typeof unityObject != "undefined"

    {

       
GetWindowSize();

       
unityObject.embedUnity("unityPlayer""WebPlayer.unity3d"winWidthwinHeightparams);       

    }

    -->

    </
script>

    <
style type="text/css">

    <!--

    
div#unityPlayer {

       
cursor: default;

       
height100%;

       
width100%;

    }

    -->

    </
style>

    </
head>

    <
body margin="0" marginwidth="0" marginheight="0" scroll="no" onResize="ResizeUnity()">

       <
div class="content">

         <
div id="unityPlayer">

          <
div class="missing">

              <
a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">

              </
a>

          </
div>

         </
div>

       </
div>

    </
body>

</
html

quindi un utente gli manda quel script che ti ho dato prima:
It seems the GetUnity() function wasn't grabbing an element high enough up its div hierarchy for me to resize the correct element. Updating my ResizeUnity() function with this did the trick(codice sopra)
ps: questo script è per ridimensionare il player quindi penso che lo puoi fare delle misure che ti servono.
 
Rispondi
  


Discussioni simili
Discussione Autore Risposte Letto Ultimo messaggio
  Addio al Web Player di Unity Chip 0 661 10-10-2015, 01:41 PM
Ultimo messaggio: Chip
  controllo player 3 persona giggimito 0 565 19-04-2015, 03:11 PM
Ultimo messaggio: giggimito
  Iniziare a programmare un videogioco.. Un piccolo aiuto? Biagino 28 2,388 10-08-2014, 04:10 PM
Ultimo messaggio: Biagino
Exclamation teletrasporto player in unity 3D leoMetal 4 1,409 02-04-2013, 04:57 PM
Ultimo messaggio: abcd
  giochi web player gufo92 1 817 11-02-2013, 10:07 AM
Ultimo messaggio: THB93
  Web player vs exe gufo92 6 909 27-07-2012, 03:21 PM
Ultimo messaggio: marf
  danno al player andrea nocentini 0 638 29-06-2012, 02:05 AM
Ultimo messaggio: andrea nocentini
  aggiungere rumore passi al mio player ugavle 2 1,833 25-02-2012, 04:24 PM
Ultimo messaggio: ugavle
  1000 Player FPS, World Record - 29 Jan 2012 Skyline 22 2,681 03-02-2012, 09:55 AM
Ultimo messaggio: KillerZ

Vai al forum:


Browsing: 1 Ospite(i)