Skip to main content

Recommended Photoshop (.PSD) Layers Structure for Smart Importer

このページでは、Smart ImporterでAdobe Photoshop(.psd)/Adobe XD(.XD)/Figma(.fig)のファイルをインポートする時に、ファイル内のグループアイテムに、自動的にコントロールを適用させてインポートするための、各ファイルの作成方法を説明します。

自動的に適用させることが可能なコントロールは、TouchableとCommonカテゴリーのコントロールに限られます。


Adobe Photoshop(.psd)の作成方法

作成方法は次の通りです。

    自動的に適用させたいコントロールのグループを作成し、グループ名を "SC_コントロール名" とします。この例では、TextButtonコントロール用いるため、"SC_TextButton" とします。(図1の青枠部分) 1. で作成したグループの下に、コントロールが持つプロパティのレイヤーを作成します。(図1の赤枠と緑枠の部分) レイヤーの名前を、コントロールが持つプロパティと同じ名前に設定します。その際、プロパティ名に使用されているスペースは削除してください。(図1のレイヤー名は、図2のプロパティ名に対応します)
    drawing-7-1686224319.png

    上記の方法にしたがい作成されたPSDファイルを [ インポート ] > [ Smart Importer ] > [ ローカルファイル... ]から開くと、Smart Importerダイアログが開き、PSDファイルのレイヤー構造に合わせて読み込まれます。すでに、TextButtonが適用されていることを確認できます。

    drawing-7-1686217980.png

    Smart Importerダイアログのアピアランスタブやベーシックプロパティタブでも、PSDファイルのレイヤーが各プロパティに反映されていることを確認できます。
    drawing-7-1686218123.png

    インポート後のプロパティパネルでも、PSDファイルのレイヤーが反映されていることを確認できます。

    drawing-7-1686218252.png

    インポートされたコントロールのサイズは、プロパティに適用されている最大サイズのの画像レイヤーの幅と高さに合わせられます。

    レイヤーとプロパティが一致しないノードをインポートすると、新しいグループノードが作成され、追加のプロパティがその子要素として追加されます。

    drawing-4-1682649584.png

    Adobe XD(.xd)ファイルの作成方法

    基本的な作成方法は、「Adobe Photoshop(.psd)の作成方法」と同一です。下図のTextButtonコントロールの例のように、Adobe XDのアイテムの構成を、自動適用させたいコントロールの構成/プロパティ名に合わせて設定してください。

    drawing-7-1686221302.png

    Figma(.fig)ファイルの作成方法

    基本的な作成方法は、「Adobe Photoshop(.psd)の作成方法」と同一です。下図のTextButtonコントロールの例のように、Figmaのアイテムの構成を、自動適用させたいコントロールの構成/プロパティ名に合わせて設定してください。

    drawing-7-1686221785.png

    以降は、英訳の必要はありません。無視してください。

    These are the recommended steps for Photoshop layers' naming and structure of a Control when creating a PSD file with Adobe Photoshop. This procedure makes it easier to apply properties to a Control via the Smart Importer.

    1. Create a group for the target Control - in this case, a TextButton (blue highlight in Figure 1 below)
    2. Create layers for the properties of the Control under the group created in step 1. (red and green highlight in Figure 1)
    3. Set the names of the layers to be the same as the property names of the target Control. (layers names in Figure 1 correspond to property names in Figure 2)
    drawing-4-1676358187.pngdrawing-4-1676358187.png



    How to set appropriate group and layer names:

    • The group name is arbitrary.
    • For the layer name, use the property name but remove the spaces. For example, "Normal Image" becomes "NormalImage".


    The below image shows the Smart Importer dialog when a PSD file following the correct format is opened.
    It is imported according to the layer structure of the PSD file.

    drawing-4-1676358219.pngdrawing-4-1676358219.png


    In the Smart Importer dialog, if you apply the TextButton control to the TextButton node, the layers of the PSD file will be reflected in each property as shown in the below image.

    drawing-4-1676358269.pngdrawing-4-1676358269.png


    The below image shows the Properties panel after import settings shown in the above image. The contents/layers of the PSD file are reflected in the Properties panel.

    drawing-4-1676358323.pngdrawing-4-1676358323.png


    The size of the imported Control will be adjusted to the Width and Height of the largest image layer applied to a property.

    In the below image, when Button is applied instead of TextButton, Text property is not applied correctly since a Button control does not have this property.

    drawing-4-1676358342.pngdrawing-4-1676358342.png


    If you import a node whose layers and properties do not match, a new Group node will be created and the extra property is added as its child element.

    drawing-4-1676358368.pngdrawing-4-1676358368.png



    Layer Structure and Naming Guideline for Controls

    In general, it is recommended to keep the PSD layer format close to the standard Controls. Below is a guide on how the layers for some Controls should be formatted and named.

    • AnalogClock
      • SecondsNeedleImage
      • MinutesNeedleImage
      • HoursNeedleImage
      • FaceImage
    • Breadcrumb
      • Name
      • EllipsisText
    • Button
      • NormalImage
      • PressedImage
      • FocusImage
    • CheckBox
      • NormalImage
      • PressedImage
      • SelectedImage
      • SelectedPressedImage
      • FocusedImage
    • CircularSlider
      • BackgroundImage
      • ActiveImage
      • ThumbImage
      • ThumbImagePressed
      • FocusImage
    • Gauge
      • NeedleImage
      • BackgroundImage
    • GroupBox
      • BackgroundImage
    • IconButton
      • NormalImage
      • PressedImage
      • FocusedImage
      • IconNormalImage
      • IconPressedImage
      • IconFocusedImage
    • InputField
      • CaretImage
      • BackgroundImage
      • FocusedImage
    • Menu Icon
      • Image
      • BackgroundImage
    • Menu Item
      • FocusImageOnSelection
      • FocusImageOnDragging
      • DeleteButtonNormalImage
      • DeleteButtonPressedImage
      • Image
    • Menu Screen
      • BackgroundImage
      • FocusBorderImage
    • Mesh2D
      • Image
    • MultiStateButton
      • ButtonState1Bmp
      • ButtonState2Bmp
      • ButtonState3Bmp
      • ButtonState4Bmp
      • FocusedImage
    • PageIndicator
      • PressedImage
      • SelectedPressedImage
      • SelectedIndicatorImage
      • IndicatorImage
      • SelectedIndicatorPressedImage
      • IndicatorPressedImage
    • RadioButton
      • NormalImage
      • PressedImage
      • SelectedImage
      • SelectedPressedImage
      • FocusedImage
    • Roll
      • DecorationImage
      • TextEditBackground
    • SpinBox
      • BackgroundImage
      • ArrowUpNormalImage
      • ArrowUpPressedImage
      • ArrowDownNormalImage
      • ArrowDownPressedImage
    • TextButton
      • Text
      • NormalImage
      • PressedImage
      • FocusedImage
    • ToggleButton
      • FirstImage
      • FirstPressedImage
      • SecondImage
      • SecondPressedImage
      • FocusedImage
    • TouchIndication
      • Image