DroidScript(cepte yada pcde programlama)

Sponsorlu Bağlantılar

AFK_is_now_AFK

Üye
//in the '/sdcard/music' folder

//Called when application is started.
function OnStart()
{
//Create layout that fills the screen.
layM = app.CreateLayout( "Linear", "FillXY,VCenter" );
laySet = app.CreateLayout( "Linear", "FillXY,VCenter" );
//Create music list.
spin = app.CreateSpinner( "[Parca bulunamadı]" );
spin.SetSize( 0.8, -1 );
spin.SetOnTouch( spn_OnTouch );
layM.AddChild( spin );

//Using unicode id instead of name [fa-pause]
txt = app.CreateText( "\uf04c Duraklat", 0.8, 0.1, "FontAwesome" );
txt.SetMargins( 0, 0.01 );
txt.SetOnTouch( txt_OnTouch );
txt.SetTextSize( 25 );
layM.AddChild( txt );

//Using unicode id instead of name [oynat]
txt2 = app.CreateText( "\uf04b Oynat", 0.8, 0.1, "FontAwesome" );
txt2.SetMargins( 0, 0.01 );
txt2.SetOnTouch( txt2_OnTouch );
txt2.SetTextSize( 25 );
layM.AddChild( txt2 );

//Using unicode id instead of name [Durdur]
txt3 = app.CreateText( "\uf04d Durdur", 0.8, 0.1, "FontAwesome" );
txt3.SetMargins( 0, 0.01 );
txt3.SetOnTouch( txt3_OnTouch );
txt3.SetTextSize( 25 );
layM.AddChild( txt3 );

//Using unicode id instead of name [Ayarlar]
txtSet = app.CreateText( "[fa-cogs] Ayarlar", 0.8, 0.1, "FontAwesome" );
txtSet.SetTextSize( 25 );
txtSet.SetOnTouch( txtSet_OnTouch );
layM.AddChild( txtSet );


//Create seek bar and add to layout.
skb = app.CreateSeekBar( 1, -1 );
skb.SetMargins(0, 0.05, 0, 0);
skb.SetRange( 1.0 );
skb.SetOnTouch( skb_OnTouch );
layM.AddChild( skb );

//Create volume bar and add to layout.
skbVol = app.CreateSeekBar( 0.4, -1 );
skbVol.SetMargins( 0.5, 0.05, 0.2, 0.2 );
skbVol.SetOnTouch( skbVol_OnTouch );
skbVol.SetRange( 2 );
skbVol.SetValue( 1 );
layM.AddChild( skbVol )
layM.SetBackground( "/sdcard/DroidScript/MP3 PLAYER/img/background.png" );

//Set second layout.
btnBack = app.CreateButton( "Geri", 0.2, 0.2 );
//btnBack.SetOnTouch( btnBack_OnTouch );
laySet.AddChild( btnBack );


//Add main layout to app.
app.AddLayout( layM );
app.AddLayout( laySet );

//Create media player.
player = app.CreateMediaPlayer();
player.SetOnReady( player_OnReady );
player.SetOnComplete( player_OnComplete );

//Find mp3 files on internal sdcard .
mp3List = app.ListFolder( "/sdcard/music", ".mp3" );
spin.SetList( mp3List );

//Load the first file found.
player.SetFile( "/sdcard/music/" + spin.GetText() );
dur = null;

//Start timer to update seek bar every second.
setInterval( "Update()", 1000 );
}

//Called when file is ready to play.
function player_OnReady()
{
//Get file duration.
dur = player.GetDuration();
app.ShowPopup( "Ready" );
}

//Called when playback has finished.
function player_OnComplete()
{
app.ShowPopup( "Finished" );
}

//Handle file select.
function spn_OnTouch( item )
{
player.SetFile( "/sdcard/music/" + item );
}

//Handle 'Play' button.
function txt2_OnTouch()
{
player.Play();
}

//Handle 'Pause' button.
function txt_OnTouch()
{
player.Pause();
}

//Handle 'Stop' button.
function txt3_OnTouch()
{
player.Stop();
}

//Called when user touches the seek bar.
function skb_OnTouch( value )
{
player.SeekTo( dur * value );
}

//Update seek bar.
function Update()
{
prog = player.GetPosition();
if( dur ) skb.SetValue( prog / dur );
}

//Called when user touches volume bar.
function skbVol_OnTouch( value )
{
player.SetVolume( value, value );
}

//Called when user touches our button
function txtSet_OnTouch()
{
layM.Animate( "SlideFromLeft" );
}
function btnBack_Ontouch()
{
layM.Animate( "SlideToLeft" );
}




CALİSMİYOR :/
 


SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
slide kısmında mı sorun yaşadın , gerçi hiçbirşey çalısmıyor :)
 
  • Beğen
Tepkiler: AFK_is_now_AFK
Hasand.

Hasand.

Üye
Teşekkürler
 
  • Beğen
Tepkiler: AFK_is_now_AFK ve SeloSoftt
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
Kod:
laySet.SetVisibility( "Hide" );
hangi layout'u arkada tutmak istiyorsan onu bu kodla gizle .
 
  • Beğen
Tepkiler: AFK_is_now_AFK

AFK_is_now_AFK

Üye
Kod:
laySet.SetVisibility( "Hide" );
hangi layout'u arkada tutmak istiyorsan onu bu kodla gizle .
Başka ne çalışmıyor ki ??? :D
Slide yaptım ana menü visibility show ayarlarinkini hide yaptım ayarlara arka plan ekledim fakat ayarlar butonuna basip geçmek istedigimde ayarlar menüsünde ne buton var ne arkaplan. Simsiyah bu sefer ikisinide show yapıyorum ikisinde görünüyor ama tek sorun su ilk açılışta ayarlar menüsü geliyor. Birde ayarlarla button eklemistim setontouch komutunu eksiksiz yazıyorum ama her seferinde su hatayı alıyorum

Script Error: btnGeri_OnTouch is not defined.
 
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
çok karışık yazmışın :)
öncelikle kodları karmaşıklıktan kurtar ki ne nerede sende bil hatayı çözerken bende rahat ayarlama yapayım :)


Kod:
  function OnStart()
        {
        //Create layout that fills the screen.
        layM = app.CreateLayout( "Linear", "FillXY,VCenter" );
        layM.SetBackground( "/Sys/Img/BlueBack.jpg" );
       
         spin = app.CreateSpinner( "[Parca bulunamadı]" );
        spin.SetSize( 0.8, -1 );
        spin.SetOnTouch( spn_OnTouch );
        layM.AddChild( spin );
       
         //Using unicode id instead of name [fa-pause]
        txt = app.CreateText( "\uf04c Duraklat", 0.8, 0.1, "FontAwesome" );
        txt.SetMargins( 0, 0.01 );
        txt.SetOnTouch( txt_OnTouch );
        txt.SetTextSize( 25 );
        layM.AddChild( txt );

       
        
        //Using unicode id instead of name [oynat]
        txt2 = app.CreateText( "\uf04b Oynat", 0.8, 0.1, "FontAwesome" );
        txt2.SetMargins( 0, 0.01 );
        txt2.SetOnTouch( txt2_OnTouch );
        txt2.SetTextSize( 25 );
        layM.AddChild( txt2 );

        //Using unicode id instead of name [Durdur]
        txt3 = app.CreateText( "\uf04d Durdur", 0.8, 0.1, "FontAwesome" );
        txt3.SetMargins( 0, 0.01 );
        txt3.SetOnTouch( txt3_OnTouch );
        txt3.SetTextSize( 25 );
        layM.AddChild( txt3 );

        //Using unicode id instead of name [Ayarlar]
        txtSet = app.CreateText( "[fa-cogs] Ayarlar", 0.8, 0.1, "FontAwesome" );
        txtSet.SetTextSize( 25 );
        txtSet.SetOnTouch( btn_OnTouch );
        layM.AddChild( txtSet );
       
       
        //Create seek bar and add to layout.
        skb = app.CreateSeekBar( 1, -1 );
        skb.SetMargins(0, 0.05, 0, 0);
        skb.SetRange( 1.0 );
        skb.SetOnTouch( skb_OnTouch );
        layM.AddChild( skb );

        //Create volume bar and add to layout.
        skbVol = app.CreateSeekBar( 0.4, -1 );
        skbVol.SetMargins( 0.5, 0.05, 0.2, 0.2 );
        skbVol.SetOnTouch( skbVol_OnTouch );
        skbVol.SetRange( 2 );
        skbVol.SetValue( 1 );
        layM.AddChild( skbVol )
       
       
        laySet = app.CreateLayout( "Linear", "FillXY,VCenter" );
        laySet.SetBackground( "/Sys/Img/GreenBack.jpg" );
        laySet.SetVisibility( "Hide" );
       
      

      //Set second layout.
        btnBack = app.CreateButton( "Geri");
        btnBack.SetOnTouch(btnBack_OnTouch);
        laySet.AddChild( btnBack );


        //Add main layout to app.
        app.AddLayout( layM );
        app.AddLayout( laySet );

        //Create media player.
        player = app.CreateMediaPlayer();
        player.SetOnReady( player_OnReady );
        player.SetOnComplete( player_OnComplete );

        //Find mp3 files on internal sdcard .
        mp3List = app.ListFolder( "/sdcard/mp3", ".mp3" );
        spin.SetList( mp3List );

        //Load the first file found.
        player.SetFile( "/sdcard/mp3/" + spin.GetText() );
        dur = null;

        //Start timer to update seek bar every second.
        setInterval( "Update()", 1000 );
        }

        //Called when file is ready to play.
        function player_OnReady()
        {
        //Get file duration.
        dur = player.GetDuration();
        app.ShowPopup( "Ready" );
        }

        //Called when playback has finished.
        function player_OnComplete()
        {
        app.ShowPopup( "Finished" );
        }

        //Handle file select.
        function spn_OnTouch( item )
        {
        player.SetFile( "/sdcard/mp3/" + item );
        }

        //Handle 'Play' button.
        function txt2_OnTouch()
        {
        player.Play();
        }

        //Handle 'Pause' button.
        function txt_OnTouch()
        {
        player.Pause();
        }

        //Handle 'Stop' button.
        function txt3_OnTouch()
        {
        player.Stop();
        }

        //Called when user touches the seek bar.
        function skb_OnTouch( value )
        {
        player.SeekTo( dur * value );
        }

        //Update seek bar.
        function Update()
        {
        prog = player.GetPosition();
        if( dur ) skb.SetValue( prog / dur );
        }

        //Called when user touches volume bar.
        function skbVol_OnTouch( value )
        {
        player.SetVolume( value, value );
        }

     
function btn_OnTouch()
{
    laySet.Animate( "SlideFromLeft" );
}

//Called when user touches our back button.
function btnBack_OnTouch()
{
    laySet.Animate( "SlideToLeft" );   
}


butona atadıgın içib ''btn'' olması gerekiyor sanırım böyle yapınca sıkıntı kalmıyor .
 
  • Beğen
Tepkiler: AFK_is_now_AFK

AFK_is_now_AFK

Üye
arkaplan dosyasını nerden buldun acaba o kadar mükemmel uymuş objeler yazıyı kapamio çok guzel
 
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
Kendim ekledim arkaplanları.
 
  • Beğen
Tepkiler: AFK_is_now_AFK

AFK_is_now_AFK

Üye
Evet de internettenmi yoksa photoshop danmi
 
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
PhotoShop'la yapıyorum.
 
  • Beğen
Tepkiler: AFK_is_now_AFK

AFK_is_now_AFK

Üye
PC denmi yoksa teldenmi eğer teldense hangi uygulama?
 
Tufkan

Tufkan

Üye
Bende teldede photoshop var internette bulabilirsin photoshop touch
 
  • Beğen
Tepkiler: AFK_is_now_AFK
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
PC deki PhotoShop ile yapıyorum uygulama arkaplanı oluştururken genel olarak 480*800 pixel olarak ayarlıyorum.
 
  • Beğen
Tepkiler: AFK_is_now_AFK

AFK_is_now_AFK

Üye
Selosoft sizin kullanıcı resminizdeki about bölümünü nasıl yaparım o pencerenin bir adi var mi ben bulamadım da.
 
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
işte böyle :)

resim = app.CreateImage( "Img/logo1.png",0.4); bu bölüme resim dosyası eklemeyi unutma.
Ve bir butona ekle fonksiyonu.


Kod:
function Bilgi()
{
 
    About = app.CreateDialog( "FlashL" );
    layAbout = app.CreateLayout( "linear", "vertical,fillxy" );
    resim = app.CreateImage( "Img/logo1.png",0.4);
    resim.SetMargins( 0, 0.01, 0,-0.1 );
    txt = app.CreateText( "Publisher by SeloSoft\nPowered by DroidScript", 0.8, 0.2, "Multiline" );
    txt.SetTextColor("#ffffff");
    txt.SetMargins( 0, 0.099, 0,-0.1 );
    txt.SetTextSize( 15 );
    layAbout.AddChild( resim )
    layAbout.AddChild( txt )
    About.AddLayout( layAbout );
    About.Show();
 
}


Eğer arkaplanları çok sevdiysen onlarıda ekleyim buraya ?



 
  • Beğen
Tepkiler: AFK_is_now_AFK

AFK_is_now_AFK

Üye
işte böyle :)

resim = app.CreateImage( "Img/logo1.png",0.4); bu bölüme resim dosyası eklemeyi unutma.
Ve bir butona ekle fonksiyonu.


Kod:
function Bilgi()
{
 
    About = app.CreateDialog( "FlashL" );
    layAbout = app.CreateLayout( "linear", "vertical,fillxy" );
    resim = app.CreateImage( "Img/logo1.png",0.4);
    resim.SetMargins( 0, 0.01, 0,-0.1 );
    txt = app.CreateText( "Publisher by SeloSoft\nPowered by DroidScript", 0.8, 0.2, "Multiline" );
    txt.SetTextColor("#ffffff");
    txt.SetMargins( 0, 0.099, 0,-0.1 );
    txt.SetTextSize( 15 );
    layAbout.AddChild( resim )
    layAbout.AddChild( txt )
    About.AddLayout( layAbout );
    About.Show();
 
}


Eğer arkaplanları çok sevdiysen onlarıda ekleyim buraya ?



Çok teşekkürler :)
Way arkadaş unity 3d de JavaScript ile oyun yaziliyomuymus. Agzim açıldı şuan :O
 
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
evet öyle , bende DS ile yapılan bir oyunu modifiye ediyorum DARKORBİT e benzer birşeye benzetiyorum sanırım bu oyunu çok geliştireceğim kim bilir satarım belki de :)
 
  • Beğen
Tepkiler: AFK_is_now_AFK

AFK_is_now_AFK

Üye
evet öyle , bende DS ile yapılan bir oyunu modifiye ediyorum DARKORBİT e benzer birşeye benzetiyorum sanırım bu oyunu çok geliştireceğim kim bilir satarım belki de :)
Way be peki ben simdi windowsa unity indirip yazmaya başlasam aynı ds deki gibimi olcak ??
Mantıken ikiside js neden olmasın :D
 
SeloSoftt

SeloSoftt

Üye
    Konu Sahibi
Düz mantık olur öyle :) kısmen çalışabilir html .js olursa native tarzında olur çalışır o zaman saf javascript sanırım çalışmaz küçük hatalar olabilir ekran sıkıntısı olabilir vs.
 
  • Beğen
Tepkiler: AFK_is_now_AFK
Takipçi Satın Al


Üst Alt