LouiZeForum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
LouiZeForum

3D vrml
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  3Dchats / forums3Dchats / forums  
Le Deal du moment :
Manga Chainsaw Man : où acheter le Tome 17 ...
Voir le deal
19.99 €

 

 Position Absolut Fixed / Bouton / Gui

Go down 
2 posters
AuthorMessage
Findescarrotte
+1000
+1000



Number of posts : 1956
Registration date : 2007-06-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 16:54

Position Absolut Fixed

Oui c'est possible ! j'ai trouver ce scripte , héhé ,déja bidouller
pour en faire ce que je veus !!

J'ai placer 2 autres camera a mon player et placer les
boutons en haut a droite.

le scripte a pour effet de garder Position Absolut Fixed ,
si on compile en 900x600 , il faut réécrire dans le scripte dans les valeurs

exemple:

Code:
var rHorizontal : float = 960.0; //final Screen
var rVertical : float = 600.0; //final Screen

le scripte recadre en fullscrenn Position Absolut Fixed , avec cette commende

Code:
GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(1.0f * Screen.width / rHorizontal, 1.0f * Screen.height / rVertical, 1.0f));

Position Absolut Fixed / Bouton / Gui  Dn1410

Donc même le Tchat MySQL peut lui aussi garder une possition absolut fixed

le scripte modifier

Code:

var camera_visite : GameObject;
var camera_perspective : GameObject;
var camera_dessus : GameObject;
var customSkin : GUISkin;
var rHorizontal : float = 960.0; //final Screen
var rVertical : float = 600.0; //final Screen

function Start () {

camera_visite.active=true;
camera_dessus.active=true;
camera_perspective.active=true;
}


function OnGUI() {

GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(1.0f * Screen.width / rHorizontal, 1.0f * Screen.height / rVertical, 1.0f));


GUI.skin = customSkin;
//(300,0,130,25) original "0=vertical Screen" "300=horizontalScreen" "130=longueur Bouton" "25=largeur Bouton"
if(GUI.Button(Rect(895,0,130,25),"Mode Visite"))
{
camera_visite.active=true;
camera_perspective.active=false;
camera_dessus.active=false;
}
//(300,0,130,25) original "0=vertical Screen" "300=horizontalScreen" "130=longueur Bouton" "25=largeur Bouton"
if(GUI.Button(Rect(895,30,130,25),"Mode Perspective"))
{
camera_visite.active=false;
camera_perspective.active=true;
camera_dessus.active=false;
}
//(300,0,130,25) original "0=vertical Screen" "300=horizontalScreen" "130=longueur Bouton" "25=largeur Bouton"
if(GUI.Button(Rect(895,60,130,25),"Mode dessus"))
{
camera_visite.active=false;
camera_perspective.active=false;
camera_dessus.active=true;
}

}


DEMO
http://retro3d.fr/DN/DN2/WebPlayer/WebPlayer.html


Le topie de la source

http://www.unity3d-france.com/unity/phpBB3/viewtopic.php?f=7&t=2140&p=9747&hilit=Matrix#p9747
Back to top Go down
Findescarrotte
+1000
+1000



Number of posts : 1956
Registration date : 2007-06-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 17:00

Information : a savoir

si votre bouton fait comme moi longueur de 130 pixel , et que vous désirer le placer
en haut a droite , c'est pas 960 -130 ,,, il faut prendre le centre du bouton ou votre gui ,
le diviser par deux ( 960 - 65 = 895 pixel)

Code:
GUI.Button(Rect(895,0,130,25)


Last edited by Peugeotfast on Wed 23 May - 18:37; edited 1 time in total
Back to top Go down
alain
fondateur
fondateur
alain


Number of posts : 23529
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 17:34

oki archivé Smile

merciiii
Back to top Go down
Findescarrotte
+1000
+1000



Number of posts : 1956
Registration date : 2007-06-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 18:34

Very Happy C'est chose faite , j'ai codé les quelques lignes pour le Chat ,

du scripte .Js au .Cs (chat )

Quote :
Donc même le Tchat MySQL peut lui aussi garder une possition absolut fixed

Position Absolut Fixed / Bouton / Gui  Dn1510

Dans le scripte chat , rajoute cette ligne , a cette endroit, toujours pour une compile de 960 x 600

Code:
//Position de la fenetre
private float rHorizontal      = (float)960.0;
private float rVertical        = (float)600.0;

puis : rajoute cette ligne , a cette endroit ,

Code:
void OnGUI()
   {
      GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(1.0f * Screen.width / rHorizontal, 1.0f * Screen.height / rVertical, 1.0f));

puis : Modifie cette ligne :

Code:
private float posChat    = (float)360;//((Screen.height/4)*0.2);

j'ai rajouter
Code:
(float)360;
et déactiver
Code:
//((Screen.height/4)*0.2);

(float)360 est la valeur hauteur sens toucher au reste du scripte







Back to top Go down
Findescarrotte
+1000
+1000



Number of posts : 1956
Registration date : 2007-06-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 22:30

J'ai pas monter le teste du fixed chat , voila !!!! avec hohohohoho ! paris !!!

Position Absolut Fixed / Bouton / Gui  Dn1610

Position Absolut Fixed / Bouton / Gui  Dn1710

Demo

http://retro3d.fr/DN/DN3/WebPlayer/WebPlayer.html

Back to top Go down
Findescarrotte
+1000
+1000



Number of posts : 1956
Registration date : 2007-06-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 22:49

le model , j'ai été le pecher sur google 3d alain !
les arbres , j'ai juste mi les shaders en diffuse transparente , double face ,
mais avec les simple face et que tu veus double , alors passe avec le shader diffuse particule

Position Absolut Fixed / Bouton / Gui  Dn1810

bon , il faut que je regarde le scroll barre mdr , je l'avais pas vue ! avant de compiler

Back to top Go down
Findescarrotte
+1000
+1000



Number of posts : 1956
Registration date : 2007-06-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 23:12

Very Happy
hahaha ! une simple erreur , avec mon scroll barre ,
j'avais oublier d'editer a la ligne du screllbarre ( GUILayout.Width(400) ) origine 600 ,
comme j'ai tout changer en 400 le Width devais lui aussi etre a 400 ...
Back to top Go down
Findescarrotte
+1000
+1000



Number of posts : 1956
Registration date : 2007-06-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyWed 23 May - 23:33

Position Absolut Fixed / Bouton / Gui  Dn1910

Position Absolut Fixed / Bouton / Gui  Dn2010


Demo

http://retro3d.fr/DN/DN3/WebPlayer/Paris.html
Back to top Go down
alain
fondateur
fondateur
alain


Number of posts : 23529
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  EmptyThu 24 May - 8:59

c'est là que tu pourrais mettre ton ascenseur , non ? Smile
Back to top Go down
Sponsored content





Position Absolut Fixed / Bouton / Gui  Empty
PostSubject: Re: Position Absolut Fixed / Bouton / Gui    Position Absolut Fixed / Bouton / Gui  Empty

Back to top Go down
 
Position Absolut Fixed / Bouton / Gui
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
LouiZeForum :: ARTS :: 3D art :: unity 3d-
Jump to: