davut
İstanbul-II (Anadolu)
19/09/2016 tarihinden beri üye
15
GY Puanı
104K
GY Sırası
Kişisel Sayfaları
İlgi Alanları
1
Rozet
0
Sertifika
2
Soru Sordu
0
Cevap Verdi
0
Blog Yazısı
0
Etiket Takibi
İş Tecrubesi
Kullanıcıya ait İş tecrübesi bilgisi bulunmamaktadır.
Eğitim Geçmişi
İstanbul Üniversitesi
| Aralık 2020
- Aralık 2020
Sertifikalar & Başarılar
GY Sertifikaları
(0)
Kullanıcının GY sertifikası bulunmamaktadır.
Diğer Sertifikaları
(0)
Kullanıcıya ait sertifika bulunmamaktadır.
Test Sonuçları
(0)
Kullanıcıya ait test sonucu bulunmamaktadır.
Dil Becerileri
Son Forum Aktiviteleri
2Oyuna 2 reklam ekleme
Mrb. arkadaşlar oyun içerisine hem baner hemde geçiş reklamı eklemek istiyorum. Aşağıdaki kodlarda baner reklam çalışıyor ancak geçiş reklam nasıl ekleyebilirim. Yardımcı olabilirseniz sevinirim.
ads.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="banner_id"> ca-app-pub-xxxxxxxxxxxxxxxxxx</string>
</resources>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.play"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="22" />
<!-- Used to request banner and interstitial ads. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Used to avoid sending an ad request if there is no connectivity. -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/GdxTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.google.AndroidLauncher"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
</application>
</manifest>
AndroidLauncher.java
package com.codecanyon.xxxx;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.randombot.swaptheglyph.SwapTheGlyph;
import com.randombot.swaptheglyph.utils.Resolver;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
public class AndroidLauncher extends AndroidApplication implements Resolver {
private static final boolean ADS = true;
private AdView adView;
private String facebook;
private String twitter;
private String market;
private String randombot;
private String appName;
private String googlePlay;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.facebook = getString(R.string.facebook);
this.twitter = getString(R.string.twitter);
this.market = getString(R.string.market);
this.randombot = getString(R.string.randombot);
this.appName = getString(R.string.app_name);
this.googlePlay = getString(R.string.google_play);
// Create the libgdx View
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.hideStatusBar = true;
cfg.useAccelerometer = false;
cfg.useCompass = false;
cfg.useImmersiveMode = true;
cfg.useWakelock = false;
if (ADS) {
// Create the layout
RelativeLayout layout = new RelativeLayout(this);
// Do the stuff that initialize() would do for you
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow()
.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
View gameView = initializeForView(new SwapTheGlyph(this), cfg);
this.adView = new AdView(this);
this.adView.setAdUnitId(getString(R.string.banner_id));
this.adView.setAdSize(AdSize.SMART_BANNER);
this.adView.loadAd(new AdRequest.Builder().build());
/**
* Invoking { requestWindowFeature(Window.FEATURE_NO_TITLE); } will
* make the add view not to be shown until the next event (updating
* the ad every 60 seconds or pause/resume) By calling
* setBackgroundColor we force the add to show itself as soon as
* it's loaded.
*/
this.adView.setBackgroundColor(Color.TRANSPARENT);
// Add the libgdx view
layout.addView(gameView);
// Add the AdMob view
RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
adParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
adParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
layout.addView(this.adView, adParams);
// Hook it all up
setContentView(layout);
} else {
initialize(new SwapTheGlyph(this), cfg);
}
}
@Override
protected void onPause() {
if (ADS) {
adView.pause();
}
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
if (ADS) {
adView.resume();
}
}
@Override
protected void onDestroy() {
if (ADS) {
adView.destroy();
}
super.onDestroy();
}
@Override
public void onBackPressed() {
}
@Override
public void resolve(int which, int arg) {
switch (which) {
case RANKING: {
break;
}
case SHARE: {
Intent sharingIntent = new Intent(
android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "Let's play " + this.appName + "!\n"
+ this.googlePlay;
sharingIntent
.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share via"));
break;
}
case SHOW_URI: {
String res = "";
switch (arg) {
case SHOW_URI_FACEBOOK:
res = this.facebook;
break;
case SHOW_URI_TWITTER:
res = this.twitter;
break;
case SHOW_URI_MARKET:
res = this.market;
break;
case SHOW_URI_RANDOMBOT:
res = this.randombot;
break;
}
Uri myUri = Uri.parse(res);
Intent intent = new Intent(Intent.ACTION_VIEW, myUri);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(intent);
break;
}
default:
break;
}
}
}
8 yıl önce yanıtladın
Label Font Değiştirme
Mrb. arkadaşlar.
Android studio üzerinde oyun kodları düzenlemeye çalışıyorum.
Oyun içerisindeki yazıların fontlarını skin dosyasından çekiyor.
Bunun yerine Arial vs gibi font eklemem için nasıl yapmam gerekiyor. Kodlar aşağıdaki gibidir.
Şimdiden teşekkür ederim
@Override
public void create() {
super.create();
previousScreen = menu;
final Label descriptionTitleLabel = new Label(descriptionTitle, skin);
descriptionTitleLabel.setColor(Color.ORANGE);
final Label descriptionTextLabel = new Label(descriptionText, skin);
descriptionTextLabel.setWrap(true);
final Label objectivesTitleLabel = new Label("\n" + objectivesTitle, skin);
objectivesTitleLabel.setColor(Color.YELLOW);
final Label objectivesTextLabel = new Label(objectivesText, skin);
objectivesTextLabel.setWrap(true);
final Label elementsTitleLabel = new Label("\n" + elementsTitle, skin);
elementsTitleLabel.setColor(Color.YELLOW);
final Label elementsTextLabel = new Label(elementsText, skin);
elementsTextLabel.setWrap(true);
descriptionTitleLabel.setFontScale(0.9f);
objectivesTitleLabel.setFontScale(0.9f);
descriptionTextLabel.setFontScale(0.75f);
objectivesTextLabel.setFontScale(0.75f);
elementsTitleLabel.setFontScale(0.75f);
elementsTextLabel.setFontScale(0.75f);
final Table tableBody = new Table();
tableBody.defaults().fill().expand();
tableBody.add(descriptionTitleLabel);
tableBody.row();
tableBody.add(descriptionTextLabel);
tableBody.row();
tableBody.add(objectivesTitleLabel);
tableBody.row();
tableBody.add(objectivesTextLabel);
tableBody.row();
tableBody.add(elementsTitleLabel);
tableBody.row();
tableBody.add(elementsTextLabel);
final ScrollPane scroll = new ScrollPane(tableBody);
root.add(scroll).fill().expand();
root.pad(0f, 10f, 0, 10f);
root.setBackground(skin.getDrawable("dialogDimMediumAlpha"));
}
}
8 yıl önce yanıtladın