Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2001
    Messaggi
    72

    valore di variabile massimo raggiungibile

    Ciao a tutti...
    Come faccio a settare per una variabile che aumenta, il suo valore massimo ?
    In pratica ho un'alfa che aumenta... vorrei che non raggiungesse 100% ma l' 80 o il 50%
    in pratica partendo da questo script...


    this._alpha += 5;

    Grazie
    "we have always to look forward"
    ....::::angelSIGN::::....

  2. #2
    Utente di HTML.it L'avatar di Nuke
    Registrato dal
    Feb 2001
    Messaggi
    633
    Metti un controllo del tipo:

    if ( this._alpha == 80){
    this._alpha = this._alpha;
    // in pratica riassegna ad alpha il suo valore o fa altro..
    } else {
    this._alpha += 5;
    }

    o anche..

    if not ( this._alpha == 80){
    this._alpha += 5;
    }


    ovviamente al posto di 80.. metti il valore che vuoi che raggiunga al massimo

    Finding the answers comes knowledge knowing what the answers mean comes wisdom - http://www.catb.org/hacker-emblem/hacker.png

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.